Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

Why HTTP header "Accept" always have a value even I did not set it.

$
0
0

I'm testing my web api on IIS Express by using Fiddler. In the debug mode, I can clearly confirm my HTTP header "Accept" was not set with any value, because I do really not set that "Accept" header when I requesting.

Now, the problem is coming, when I deploy the project to the IIS 8.5 (on Windows 2012 R2), I found the "Accept" header is always set to "text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8" even I reqeust without the "Accept" header.

In WebAPI the response format should be determine by the "Content-Type" if "Accept" is missing, but now this default "Accept" header makes all unspecifed "Accept" request returning an xml format response.

Is there any modules or handlers will put the default headers in my request, how could I avoid this default "Accept" header ?


Viewing all articles
Browse latest Browse all 7363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>