System.InvalidOperationException: Misused header name.

Hi Team,

I’m having an issue with a POST request from BC when trying to set the Content-Type header… code snippet below.

MyContent.WriteFrom(’{“query”: “{boards(limit: 1){id name}}”}’);
MyContent.GetHeaders(Headers);
Headers.Remove(‘Content-Type’);
Headers.Add(‘Content-Type’, ‘application/json’);
Headers.Add(‘Authorization’, #####);
MyContent.GetHeaders(Headers);

    //Load the content into the request
    Request.Content := MyContent;
    Request.Method := 'POST';
    Request.SetRequestUri(#####);

    Client.Send(Request, ResponseMessage);

this results in a System.InvalidOperationException: Misused header name error.
Any ideas?

Much Appreciated!

Same issue here. Did you find a solution?