cancel
Showing results for 
Search instead for 
Did you mean: 

WebApi: Unable to set Content-Type header via parameter

BenKaiser
Level 2
I am able to set other custom headers to the parameters passed into a webapi using [parameter name] or to be more specific my parameter is named "content type" so [content type]. However when I attempt to set the header Content-Type it takes this value as a literal string and in fiddler I see:  POST https://example.com/rest/integration HTTP/1.1 Content-Type: [content type] kaiser-header: application/json Authorization: Basic YWRtaW4udefsXNlcjmVlZHRvYWRtaW5pc3Rlcg== Host: example.com Content-Length: 15 {"blah":"blah"}
1 REPLY 1

BenKaiser
Level 2
There to be a bug in the current WebAPI that does not allow dynamic assignment of special reserved HTTP headers such as “Host”, “Content-Type”, etc.