private ApiResponse<object> SettingsPageSetToken(string invalidToken, TestCoreFramework.Enums.HttpMethod httpMethod) { using (var coreConnection = new AuthApiConnection { SuppressAuthentication = true }) { coreConnection.RegisterAuthHeader(invalidToken); if (httpMethod != TestCoreFramework.Enums.HttpMethod.GET) { return new DefaultManager(coreConnection).Send(new SettingSetRequest { AllowedRolePwdLogin = 2, ComnanyId = Convert.ToInt32(AuthenticationInfoProvider.Current.DefaultPartition), LoginUrl = "http://test.com/", SsoEnabled = true }, additionalSettings: new DefaultManager.AdditionalRequestSettings { Endpoint = CommonConstants.SettingUIUrl, UrlParameters = new Dictionary<string, string> { ["companyId"] = AuthenticationInfoProvider.Current.DefaultPartition }, HttpMethod = httpMethod }); } return new DefaultManager(coreConnection).Send(CommonConstants.SettingUIUrl, new Dictionary<string, string> { ["companyId"] = AuthenticationInfoProvider.Current.DefaultPartition }, TestCoreFramework.Enums.HttpMethod.GET); } }
public async Task <ApiResponse <object> > SendAsync(string endpoint, string content, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json") { return(ProcessResponseWithContent <object>(await Connection.SendAsync(endpoint, content, _httpMethodMap[httpMethod], contentType))); }
public ApiResponse <object> Send(string endpoint, IEnumerable <KeyValuePair <string, string> > parameters, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json") { return(SendAsync(endpoint, parameters, httpMethod, contentType).Result); }
public async Task <ApiResponse <object> > SendAsync(string endpoint, IEnumerable <KeyValuePair <string, string> > parameters, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json") { return(ProcessResponseWithContent <object>(await Connection.SendAsync(endpoint, parameters, _httpMethodMap[httpMethod], contentType))); }
public ApiResponse <T> Send <T>(string endpoint, string content, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json") { return(SendAsync <T>(endpoint, content, httpMethod, contentType).Result); }