public Api(IRequestor requestor) { Applicants = new Applicants(requestor); Documents = new Documents(requestor); Checks = new Checks(requestor); Reports = new Reports(requestor); }
public StripeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder) { ApiKey = apiKey; Mapper = mapper; Requestor = requestor; ParameterBuilder = parameterBuilder; }
static Requestor() { #if WINDOWS_UWP Instance = new UniversalRequestor(); #else Instance = new DefaultRequestor(); #endif }
public async Task <TResponse> Handle(IRequestor <TResponse> request, CancellationToken cancellationToken) { ValidationResult result = await this.validator.ValidateAsync(request.Item);; if (result.IsValid) { return(await this.handle(request, cancellationToken)); } throw new ArgumentException(String.Join(",", result.Errors)); }
public IResponse Request(string method, string path, RequestInfo info, IRequestor requestor) { var url = Url(path, info.QueryStrings); try { CurrentUri = new Uri(url); } catch (Exception ex) { Console.WriteLine("BAD URI. method:{0} path:{1} url:{2}", method, path, url); LastException = ex; // We don't return null here because a custom IRequestor could support this URL, even if it's not a valid URI } IResponse response; try { response = requestor.GetResponse(method, url, info.PostData, MergeWithDefaultHeaders(info.Headers)); } catch (Exception ex) { Console.WriteLine("Requestor ({0}) failed to respond for {1} {2} [{3}]", requestor.GetType(), method, path, url); Console.WriteLine("Requested info:"); Console.WriteLine("\t{0} {1}", method, url); Console.WriteLine("\tPostData: " + string.Join(", ", info.PostData.Select(item => string.Format("{0} => {1}", item.Key, item.Value)).ToArray())); Console.WriteLine("\tHeaders: " + string.Join(", ", info.Headers.Select(item => string.Format("{0} => {1}", item.Key, item.Value)).ToArray())); LastException = ex; return(null); } if (response == null) { return(null); } if (AutoRedirect) { while (IsRedirect(response)) { response = FollowRedirect(response); } } return(SetLastResponse(response)); }
public Requestor(IRequestor implementation) { Implementation = implementation; }
public Reports(IRequestor requestor) { _requestor = requestor; }
public PingController(IRequestor requestor) { _requestor = requestor; }
public StudentsController(IRequestor requestor) { _requestor = requestor; }
protected BaseMoney(IRequestor requestor) { Requestor = requestor; requestor.ParentResourceName = parentResourceName; }
public StripeChargeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder) : base(apiKey, mapper, requestor, parameterBuilder) { }
public AppHangfireJobProcessor(IRequestor requestor, IAppLogger <AppHangfireJobProcessor> logger) { _requestor = requestor; _logger = logger; }
public Checks(IRequestor requestor) { _requestor = requestor; }
public Applicants(IRequestor requestor) { _requestor = requestor; }
public Documents(IRequestor requestor) { _requestor = requestor; }
public Broswer(IRequestor requestor) { _requestor = requestor; }
protected abstract Task <TResponse> handle(IRequestor <TResponse> request, CancellationToken cancellationToken);
public AppMessageConsumer(IRequestor requestor, IAppLogger <AppMessageConsumer <TRequest> > logger) { _requestor = requestor; _logger = logger; }
public PostRegistrationTask(IRequestor requestor) { _requestor = requestor; }
protected override Task <U.User> handle(IRequestor <U.User> request, CancellationToken cancellationToken) { return(this.repository.CreateAsync(request.Item)); }
public StripeDisputeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder) : base(apiKey, mapper, requestor, parameterBuilder) { }
protected BaseTransaction(IRequestor requestor) { Requestor = requestor; requestor.ParentResourceName = parentResourceName; }