public BaseApiTest() { _factory = new HttpFactory(); _logger = new Mock <ILogger>().Object; _client = new Mock <DefaultApiClient>(_logger, _factory); _client.Setup(api => api.DoExecute(Request)).Returns(new Task <string>(() => GetResponse())); }
public RestClient(IHttpFactory httpFactory, IRestClientConfiguration restClientConfiguration) { Guard.ArgumentIsNotNull(httpFactory, "httpFactory"); Guard.ArgumentIsNotNull(restClientConfiguration, "restClientConfiguration"); _httpFactory = httpFactory; RestClientConfiguration = restClientConfiguration; }
/// <summary> /// Default constructor that registers default content handlers /// </summary> /// <param name="restSharpHttpFactory">This parameter typically provided by Dependency Injection.</param> public RestClient(IHttpFactory restSharpHttpFactory) { if (restSharpHttpFactory == null) { throw new ArgumentNullException(nameof(restSharpHttpFactory)); } this.HttpFactory = restSharpHttpFactory; this.Encoding = new UTF8Encoding(false); // Encoding.UTF8 emits byte order mark, which we don't want. this.ContentHandlers = new Dictionary <string, IDeserializer>(); this.AcceptTypes = new List <string>(); this.DefaultParameters = new List <Parameter>(); // There are no default handlers. this.FollowRedirects = true; }
public EcouponsService(IHttpFactory httpFactory, IConfiguration configuration, IMapper mapper) { _httpFactory = httpFactory; _configuration = configuration; _mapper = mapper; }
public CommentsService(IHttpFactory httpFactory, IThingMapper thingMapper) { m_thingMapper = thingMapper; m_httpClient = httpFactory.Create(); }
public UserService(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
public CouponsService(IConfiguration configuration, IHttpFactory httpFactory) { _configuration = configuration; _httpFactory = httpFactory; }
public TaskService(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
public SupplierService(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
public SubredditService(IHttpFactory httpFactory, IThingMapper thingMapper) { m_httpClient = httpFactory.Create(); m_thingMapper = thingMapper; }
public HttpManager(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
public CreditCardInfra(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
/// <summary> /// Initializes a new instance of the <see cref="HttpFactory"/> class. /// </summary> public HttpFactory() { HTTPContextManager.Start(); _current = this; AddDefaultCreators(); }
public PaymentSlipInfra(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
public DefaultApiClient(ILoggerFactory loggerFactory, IHttpFactory factory) { Logger = loggerFactory?.CreateLogger <DefaultApiClient>(); _factory = factory; }
public LocationService(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
/// <summary> /// Constructor of GoogleAuthenticator. /// </summary> /// <param name="serviceName"> /// Name of service for which authentication is requested /// </param> /// <param name="timeout"> /// Timeout in miliseconds. Use Timeout.Infinite for no timeout. /// </param> internal GoogleAuthenticator(IHttpFactory httpFactory, AccountType accountType, string applicationName) { this.HttpFactory = httpFactory; switch (accountType) { case AccountType.Google: this.AccountTypeName = "GOOGLE"; break; case AccountType.Hosted: this.AccountTypeName = "HOSTED"; break; case AccountType.GoogleOrHosted: this.AccountTypeName = "HOSTED_OR_GOOGLE"; break; } this.ApplicationName = applicationName; }
/// <summary> /// Initializes a new instance of the <see cref="HttpFactory"/> class. /// </summary> public HttpFactory() { _current = this; AddDefaultCreators(); }
public ServiceDetailService(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
static WebHttp() { logger = LoggerFactory.Create("WebHttpRequests"); httpFactory = DependencyResolver.Resolve <IHttpFactory>(); }
/// <summary> /// RestClient /// </summary> /// <param name="restRequest"></param> /// <exception cref="ArgumentNullException"></exception> public RestClient(IRestRequest restRequest) { _restRequest = restRequest ?? throw new ArgumentNullException(nameof(restRequest)); _httpFactory = new HttpFactory(_restRequest); }
public ElasticsearchRepository(IHttpFactory httpFactory) { _httpFactory = httpFactory; }
public SaleForceService(IHttpFactory httpFactory, IConfiguration configuration) { _httpFactory = httpFactory; _configuration = configuration; }
internal MailUploader(IHttpFactory httpFactory, string emailId, string password, string applicationName, GoogleEmailUploaderModel googleEmailUploaderModel) { this.HttpFactory = httpFactory; this.EmailId = emailId; this.Password = password; GoogleAuthenticator authenticator = new GoogleAuthenticator(httpFactory, AccountType.GoogleOrHosted, applicationName); AuthenticationResponse resp = authenticator.AuthenticateForService(this.EmailId, this.Password, "apps"); this.MailAuthenticationToken = resp.AuthToken; resp = authenticator.AuthenticateForService(this.EmailId, this.Password, "cp"); this.ContactAuthenticationToken = resp.AuthToken; this.GoogleEmailUploaderModel = googleEmailUploaderModel; string[] splits = emailId.Split('@'); this.UserName = splits[0]; this.DomainName = splits[1]; this.MailBatch = new MailBatch(googleEmailUploaderModel); this.ContactEntry = new ContactEntry(googleEmailUploaderModel); this.PauseEvent = new ManualResetEvent(true); this.batchMailUploadUrl = string.Format( GoogleEmailUploaderConfig.EmailMigrationUrl, this.DomainName, this.UserName); this.batchContactUploadUrl = string.Format( MailUploader.ContactMigrationURLTemplate, this.EmailId); this.ApplicationName = applicationName; }
public DefaultApiClient(ILoggerFactory loggerFactory, IHttpFactory factory, IOptions <WXOptions> options) { Logger = loggerFactory?.CreateLogger <DefaultApiClient>(); _factory = factory; _options = options.Value; }
public GoogleCDNImageResizehelper(IHttpFactory httpFactory) { this.httpFactory = httpFactory; }
public VisaFormsController(DataContext context, IHttpFactory httpFactory) { _context = context; _httpFactory = httpFactory; }
public LinkService(IHttpFactory httpFactory, IThingMapper thingMapper) { m_thingMapper = thingMapper; m_client = httpFactory.Create(); }
public GoogleEmailUploaderModel(IHttpFactory httpFactory) { try { GoogleEmailUploaderTrace.EnteringMethod( "GoogleEmailUploaderModel..ctor"); this.HttpFactory = httpFactory; AssemblyName assemblyName = this.GetType().Assembly.GetName(); this.ApplicationName = string.Format(GoogleEmailUploaderModel.UserAgentTemplate, assemblyName.Version, Resources.LocaleText); this.TransitionToInitializedState(); GoogleEmailUploaderTrace.WriteLine( "GoogleEmailUploaderModel created: {0}", this.ApplicationName); } finally { GoogleEmailUploaderTrace.ExitingMethod( "GoogleEmailUploaderModel..ctor"); } }