Statistics
The Highest Post







Statistics
Count 36
Avg 276.81
Min 21
Max 9230
WebApi Top questions

Details



Peter Agyekum What is the content negotiation in Web API? Content negotiation is the process of selecting the best representation for a given response when there are multiple representations available. Means, depending on the Accept header value in the request, the server sends the response. The primary mechanism for content negotiation in HTTP are these request headers − Accept − Which media types are acceptable for the response, such as "application/json," "application/xml," or a custom media type such as "application/vnd.example+xml" Accept-Charset − Which character sets are acceptable, such as UTF-8 or ISO 8859-1. Accept-Encoding − Which content encodings are acceptable, such as gzip. Accept-Language − The preferred natural language, such as "en-us". The server can also look at other portions of the HTTP request. For example, if the request contains an X-Requested-With header, indicating an AJAX request, the server might default to JSON if there is no Accept header.