Dear all ,
I despair of the following API call:
My Code:
Result :
Error: Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.
Thank you for any help !
I despair of the following API call:
My Code:
C#:
using (HttpClient client = new HttpClient())
{
try
{
var request = new HttpRequestMessage(HttpMethod.Post, url)
{
Content = new StringContent(body, Encoding.UTF8, contentType)
};
request.Headers.Add("Content-MD5", contentMD5);
request.Headers.Add("Date", date);
request.Headers.Add("Authorization", authorization);
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
Result :
Error: Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.
Thank you for any help !
Last edited by a moderator: