My code returns headers when I post to the API, please assist
- public static async Task<object> PostCallAPI(string url, HttpContent content)
- {
- using (HttpClient client = new HttpClient())
- {
- content = new StringContent(url, Encoding.UTF8, "application/json");
- HttpResponseMessage response = await client.PostAsync(url, content);
- response.EnsureSuccessStatusCode();;
- if (response.StatusCode==HttpStatusCode.OK)
- {
- Console.WriteLine(response);
- }
- return response.Content;
- }
- }