public async Task <IActionResult> TestHTTPAsycnClient() { var request = new RequestBodyModel() { Country = "US", LogType = "Prelog", NetworkType = "National Cable" }; string apiEndpointUrl = "https://prepostloglineapi.oceanmedia.com/"; string apiKey = "fd5ef968-6096-4230-a4dd-7b9ac9eedab0"; var resultSet = default(SearchResponse); RestSharpWebApiClient restSharpWebApiClient = new RestSharpWebApiClient(_logger, "https://prepostlogwebapi.oceanmediainc.com", "US", "National Cable", "Postlog", "fd5ef968-6096-4230-a4dd-7b9ac9eedab0"); // HTTPClient Syncronus Call- Works! resultSet = await restSharpWebApiClient.HttpClientPrePostLogMethod(); return(Ok(new { Status = "Success", TotalRecords = resultSet.Data.Count, Data = resultSet.Data })); }
// GAReports Test Client public IActionResult GAReportRestSharpClient() { // GAReport API Test // string APIUrl = "http://localhost:62575/WeatherForecast"; // string APIUrl = "http://localhost:62575/WeatherForecast"; // string APIUrl = "http://localhost:62575/WeatherForecast/TestAPIClient"; string APIUrl = "http://localhost:62575/WeatherForecast/TestGAReportAPIRequest"; RestSharpWebApiClient restSharpWebApiClientGaReport = new RestSharpWebApiClient(_logger, APIUrl); restSharpWebApiClientGaReport.RestClientGAReportPostMethod(); return(View()); }