public ThreadServiceBase(IErrorHandlerService errorHandler, IHttpRequestService httpRequest) { _errorHandler = errorHandler; _httpRequest = httpRequest; Accept_Json = new KeyValuePair <string, string>("Accept", "application/json"); }
/// <summary> /// Creates a new <see cref="FluentRequest"/> with <paramref name="apiRequestService"/> used for sending the requests /// </summary> /// <param name="apiRequestService">The request sender</param> internal FluentRequest(IHttpRequestService apiRequestService) { Debug.Assert(apiRequestService != null); _apiRequestService = apiRequestService; Request = new HttpRequestMessage(); }
public Job(IHttpRequestService httpRequestService, IDecryptService decryptService, ISecurityService securityService, IFileService fileService) { _httpRequestService = httpRequestService; _decryptService = decryptService; _securityService = securityService; _fileService = fileService; }
public ExaminationService(IDateTimeService dateTimeService, IWorkingDirectoryProvider workingDirectoryProvider, IExaminationInformation examinationInformation, IMediaService mediaService, IExaminationTimer examinationTimer, IReportService reportService, IAnswersService answersService, IProgressViewModel progressViewModel, IIterationsService iterationsService, IGivenAnswerService givenAnswerService, IHttpRequestService httpRequestService, ILocalAudioMessageService localAudioMessageService, IExaminationRemoteSettings settings) { this.dateTimeService = dateTimeService; this.workingDirectoryProvider = workingDirectoryProvider; this.examinationInformation = examinationInformation; this.examinationTimer = examinationTimer; this.mediaService = mediaService; this.reportService = reportService; this.answersService = answersService; this.iterationsService = iterationsService; this.progressViewModel = progressViewModel; this.givenAnswerService = givenAnswerService; this.httpRequestService = httpRequestService; this.localAudioMessageService = localAudioMessageService; this.settings = settings; this.examinationTimer.TimeUp += TimeUpHandler; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure( IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IRTPIServiceFactory rtpiFactory, IHttpRequestService httpRequestService ) { loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); loggerFactory.AddDebug(LogLevel.Information); } else { loggerFactory.AddDebug(LogLevel.Error); } app.UseMvc(); rtpiFactory.RegisterRTPIService("LUAS", new LUASRTPIService(httpRequestService)); rtpiFactory.RegisterRTPIService("DublinBus", new DublinBusRTPIService(httpRequestService)); }
public GoogleApiProvider( IHttpRequestService httpRequestService, IApplicationSettingsProvider appSettingsProvider) { _appSettingsProvider = appSettingsProvider; _httpRequestService = new HttpRequestService(); }
public GHServiceBase(IErrorHandlerService errorHandler, IHttpRequestService httpRequest) { _errorHandler = errorHandler; _httpRequest = httpRequest; Accept_V3_Json = new KeyValuePair <string, string>("Accept", "application/vnd.github.v3+json"); }
public WebPermissionService(IPrincipalService principalService, IHttpRequestService httpRequestService, IPermissionItemService permissionService, IWebPermissionServiceAction webPermissionServiceAction, IWebPermissionServiceFile webPermissionServiceFile) { this.principalService = principalService; this.httpRequestService = httpRequestService; this.permissionService = permissionService; this.webPermissionServiceAction = webPermissionServiceAction; this.webPermissionServiceFile = webPermissionServiceFile; }
public TlApiController( IUserService userService, IHttpRequestService httpRequestService ) { _userService = userService; _httpRequestService = httpRequestService; }
public ErfassungsPeriodService(ITransactionScopeProvider transactionScopeProvider, IEntityServiceMappingEngine entityServiceMappingEngine, IHttpRequestService httpRequestService, ISecurityService securityService) : base(transactionScopeProvider, entityServiceMappingEngine, securityService) { cache = httpRequestService; }
public HttpRequestActivityModel() { DisplayName = "Http Request"; HttpRequests = new ObservableCollection<File>(); eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>(); httpRequestService = ServiceLocator.Current.GetInstance<IHttpRequestService>(); fileService = ServiceLocator.Current.GetInstance<IFileService>(); }
public HerokuServiceBase(IErrorHandlerService errorHandler, IHttpRequestService httpRequest) { _errorHandler = errorHandler; _httpRequest = httpRequest; Accept_Json_V3 = new KeyValuePair <string, string>("Accept", "application/vnd.heroku+json; version=3"); Accept_Json_V4 = new KeyValuePair <string, string>("Accept", "application/vnd.heroku+json; version=4"); }
public WatchListService( IHttpRequestService httpRequestService, IMarginTradingWatchListRepository watchListRepository, IMarginTradingSettingsCacheService marginTradingSettingsCacheService) { _httpRequestService = httpRequestService; _watchListRepository = watchListRepository; _marginTradingSettingsCacheService = marginTradingSettingsCacheService; }
public IsAliveController(MtFrontendSettings setings, IHttpRequestService httpRequestService, WampSessionsService wampSessionsService, IDateService dateService) { _setings = setings; _httpRequestService = httpRequestService; _wampSessionsService = wampSessionsService; _dateService = dateService; }
public ReportService(IDateTimeService dateTimeService, IExaminationInformation examinationInformation, IExaminationRemoteSettings examinationRemoteSettings, IHttpRequestService examinationHttpRequestService) { this.dateTimeService = dateTimeService; this.examinationInformation = examinationInformation; this.examinationRemoteSettings = examinationRemoteSettings; this.examinationHttpRequestService = examinationHttpRequestService; }
/// <summary> /// Make a request to the specified URL /// </summary> /// <typeparam name="T">The type of data expected to be returned</typeparam> /// <param name="requestService">The request service to use when sending requests</param> /// <param name="url">The URL to send the request to</param> /// <param name="method">The method to use when sending the request</param> /// <param name="body">The body of the content to send</param> /// <returns>The response from the server</returns> /// <exception cref="ArgumentNullException"><paramref name="requestService"/> or <paramref name="url"/> is <see langword="null"/></exception> /// <exception cref="UriFormatException"><paramref name="url"/> is an invalid Uri</exception> public static async Task <ApiResponseJson <T> > SendAsync <T>(this IHttpRequestService requestService, string url, string method, object body = null) { if (requestService is null) { throw new ArgumentNullException(nameof(requestService)); } return(await PrepareRequest(requestService, url, body) .SendWithJsonResponse <T>(method)); }
public SelectExaminationViewModel(ILog logger, ISettings settings, IEventBus eventBus, IHttpRequestService examinationHttpRequestService) : base(settings) { this.logger = logger; this.eventBus = eventBus; this.examinationHttpRequestService = examinationHttpRequestService; DisplayName = Resources.SelectExaminationHeader; }
public RpcFacade( MtFrontendSettings settings, IHttpRequestService httpRequestService, IMarginTradingSettingsCacheService marginTradingSettingsCacheService, IMtDataReaderClientsPair dataReaderClients) { _settings = settings; _httpRequestService = httpRequestService; _marginTradingSettingsCacheService = marginTradingSettingsCacheService; _dataReaderClients = dataReaderClients; }
public JobController( IHttpRequestService httpRequestService, ILogger <JobController> logger, IMapper mapper, IMediator mediator ) { _httpRequestService = httpRequestService; _logger = logger; _mapper = mapper; _mediator = mediator; }
public AzureADOAuthClient(IHttpRequestService httpRequestService, IApplicationContext applicationContext) { _httpRequestService = httpRequestService ?? throw new ArgumentNullException(nameof(httpRequestService)); var baseRequestBody = new Dictionary <string, string> { { "client_assertion_type", ClientConstants.ClientAssertionType }, { "client_assertion", applicationContext.AuthApplicationSecret }, { "redirect_uri", applicationContext.AuthRedirectUrl } }.ToImmutableDictionary(); _authenticationRequestBody = baseRequestBody.Add("grant_type", ClientConstants.AuthorizationCodeGrantType); _refreshTokenRequestBody = baseRequestBody.Add("grant_type", ClientConstants.RefreshTokenGrantType); }
public LeagueApiConfiguration( string key, RegionEnum? defaultRegion, bool waitToAvoidRateLimit, IHttpRequestService httpRequestService = null) { if (key == null) throw new ArgumentNullException("key"); if (httpRequestService == null) throw new ArgumentNullException("httpRequestService"); Key = key; DefaultRegion = defaultRegion; WaitToAvoidRateLimit = waitToAvoidRateLimit; HttpRequestService = httpRequestService; }
private static FluentRequest PrepareRequest(IHttpRequestService requestService, string url, object body = null) { Debug.Assert(requestService != null); var request = requestService.CreateRequest(); request.UseUrl(url); if (body is null) { return(request); } return(request.WithBody().Json(body)); }
/// <summary> /// Test /// </summary> /// <param name="httpRequestService">the httpRequestService</param> public void Test(IHttpRequestService httpRequestService) { foreach (var testCase in this) { if (testCase.Arranges.Expected != null && testCase.Arranges.Expected.HttpRequest != null) { testCase.Arranges.Expected.HttpResponse = httpRequestService.GetResponse(testCase.Arranges.Expected.HttpRequest); } if (testCase.Arranges.Actual != null) { testCase.Arranges.Actual.HttpResponse = httpRequestService.GetResponse(testCase.Arranges.Actual.HttpRequest); } testCase.Assert(testCase.Arranges.Expected, testCase.Arranges.Actual); } }
public LeagueApi( string apiKey, RegionEnum? region = null, bool waitToAvoidRateLimit = false, IHttpRequestService httpRequestService = null) { if (apiKey == null) { throw new ArgumentNullException("apiKey"); } httpRequestService = httpRequestService ?? new HttpRequestService(); LeagueApiConfiguration = new LeagueApiConfiguration(apiKey, region, waitToAvoidRateLimit, httpRequestService); Init(); }
public LeagueApi( string apiKey, RegionEnum?region = null, bool waitToAvoidRateLimit = false, IHttpRequestService httpRequestService = null) { if (apiKey == null) { throw new ArgumentNullException("apiKey"); } httpRequestService = httpRequestService ?? new HttpRequestService(); LeagueApiConfiguration = new LeagueApiConfiguration(apiKey, region, waitToAvoidRateLimit, httpRequestService); Init(); }
public OpSkinsApi ( string steamLyticsApiKey, IRepoServiceFactory repoServiceFactory, ILogServiceFactory logServiceFactory, IHttpRequestService httpRequestService, ISettingRepoService settingRepoService, ISteamMarketScraperService steamMarketScraperService ) { _apiKey = steamLyticsApiKey; _repoServiceFactory = repoServiceFactory; _logger = logServiceFactory.CreateLogger <OpSkinsApi>(); _httpRequestService = httpRequestService; _settingRepoService = settingRepoService; _steamMarketScraperService = steamMarketScraperService; }
/// <summary> /// Test async /// </summary> /// <param name="httpRequestService">the httpRequestService</param> public async Task TestAsync(IHttpRequestService httpRequestService) { foreach (var testCase in this) { if (testCase.Arranges.Expected != null && testCase.Arranges.Expected.HttpRequest != null) { testCase.Arranges.Expected.HttpResponse = await httpRequestService.GetResponseAsync(testCase.Arranges.Expected.HttpRequest); } if (testCase.Arranges.Actual != null) { testCase.Arranges.Actual.HttpResponse = await httpRequestService.GetResponseAsync(testCase.Arranges.Actual.HttpRequest); } testCase.Assert(testCase.Arranges.Expected, testCase.Arranges.Actual); } }
public OpenTicketsViewModel(IFileSystemService fileSystemService, IHttpRequestService httpRequestService, IBackgroundWorkerService backgroundWorkerService) { _fileSystemService = fileSystemService; _httpRequestService = httpRequestService; _backgroundWorkerService = backgroundWorkerService; DialogTitle = "Open Tickets"; CanClose = true; OpenGameCommand = new DelegateCommand <GameTickets>(OpenGame); OpenGameTicketsCommand = new DelegateCommand <GameTickets>(OpenGameTickets); OpenAchievementCommand = new DelegateCommand <AchievementTickets>(OpenAchievement); Progress = new ProgressFieldViewModel { Label = String.Empty }; backgroundWorkerService.RunAsync(LoadTickets); }
public PricingServiceFactory( IRepoServiceFactory repoServiceFactory, ILogServiceFactory logServiceFactory, IHttpRequestService httpRequestService, ISettingRepoService settingRepoService, IConfiguration configuration, ISteamMarketScraperService steamMarketScraperService, IJsonRequestParser jsonRequestParser ) { _repoServiceFactory = repoServiceFactory; _logServiceFactory = logServiceFactory; _httpRequestService = httpRequestService; _settingRepoService = settingRepoService; _configuration = configuration; _steamMarketScraperService = steamMarketScraperService; _jsonRequestParser = jsonRequestParser; }
protected void Application_Start() { var dateTime = DateTime.Now; SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin")); //Autofac Container Setup var container = new ServerContainerSetup().BuildContainer(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); AreaRegistration.RegisterAllAreas(); //Register Filters GlobalFilters.Filters.Add(new AuthorizationFilter(container.Resolve <IPermissionService>(), container.Resolve <ISecurityService>(), container.Resolve <ISessionService>(), container.Resolve <IEreignisLogService>())); GlobalFilters.Filters.Add(new AvailabilityFilter(container.Resolve <IAvailabilityService>())); GlobalFilters.Filters.Add(new StopwatchAttribute(), 3); // to force httpRuntime executionTimeout="10" locally //GlobalFilters.Filters.Add(new ExecutionTimeoutToGetAroundBugInMVCAttribute()); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); FluentValidationModelValidatorProvider.Configure(provider => provider.ValidatorFactory = container.Resolve <IValidatorFactory>()); ValidatorOptions.DisplayNameResolver += DisplayNameResolver; ValidatorOptions.ResourceProviderType = typeof(ValidationErrorLocalizationWrapper); transactionScopeProvider = container.Resolve <ITransactionScopeProvider>(); cookieService = container.Resolve <ICookieService>(); serverConfigurationProvider = container.Resolve <IServerConfigurationProvider>(); ereignisLogService = container.Resolve <IEreignisLogService>(); httpRequestService = container.Resolve <IHttpRequestService>(); securityService = container.Resolve <ISecurityService>(); Loggers.ApplicationLogger.DebugFormat("Initialization duration: {0} second", (DateTime.Now - dateTime).TotalSeconds); if (serverConfigurationProvider.EnableMiniProfiler) { MiniProfiler.Settings.SqlFormatter = new Web.Infrastructure.MiniProfiler.OracleFormatter(); MiniProfiler.Settings.IgnoredPaths = new[] { "/WMS", "/content/", "/scripts/", "/favicon.ico", "/OpenLayers-2.10/" }; MiniProfiler.Settings.StackMaxLength = 720; MiniProfiler.Settings.MaxJsonResponseSize = 10000000; } }
/// <summary> /// Test async /// </summary> /// <param name="httpRequestService">the httpRequestService</param> /// <param name="hookForActual">the hookForActual</param> /// <param name="hookForExpected">the hookForExpected</param> public async Task TestAsync(IHttpRequestService httpRequestService, Action <HttpClient> hookForActual = null, Action <HttpClient> hookForExpected = null) { foreach (var testCase in this) { if (testCase.Arranges.Expected != null && testCase.Arranges.Expected.HttpRequest != null) { testCase.Arranges.Expected.HttpResponse = await httpRequestService.GetResponseAsync(testCase.Arranges.Expected.HttpRequest, hookForExpected); } if (testCase.Arranges.Actual != null) { testCase.Arranges.Actual.HttpResponse = await httpRequestService.GetResponseAsync(testCase.Arranges.Actual.HttpRequest, hookForActual); } testCase.Assert(testCase.Arranges.Expected, testCase.Arranges.Actual); } }
public CsgoFastApi ( string steamLyticsApiKey, IRepoServiceFactory repoServiceFactory, ILogServiceFactory logServiceFactory, IHttpRequestService httpRequestService, ISettingRepoService settingRepoService, ISteamMarketScraperService steamMarketScraperService, IJsonRequestParser jsonRequestParser ) { _apiKey = steamLyticsApiKey; _repoServiceFactory = repoServiceFactory; _logger = logServiceFactory.CreateLogger <CsgoFastApi>(); _httpRequestService = httpRequestService; _settingRepoService = settingRepoService; _steamMarketScraperService = steamMarketScraperService; _jsonRequestParser = jsonRequestParser; }
public LeagueApiConfiguration( string key, RegionEnum?defaultRegion, bool waitToAvoidRateLimit, IHttpRequestService httpRequestService = null) { if (key == null) { throw new ArgumentNullException("key"); } if (httpRequestService == null) { throw new ArgumentNullException("httpRequestService"); } Key = key; DefaultRegion = defaultRegion; WaitToAvoidRateLimit = waitToAvoidRateLimit; HttpRequestService = httpRequestService; }
public LoginRequestService() { _httpPostService = new HttpPostService(); _deserializeJSONService = new DeserializeJSONService(); }