public RequestModel() { Url = ""; Method = ""; Headers = new List <FieldModel>(); ContentType = ""; QueryString = new List <FieldModel>(); Body = new RequestBodyModel(); }
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 })); }