Content negotiation in Web API(accept and content-type attribute of header)

Content negotiation is a way to serve client-specific representations of the same resource. A client might send this HTTP request: GET http://localhost.:21069/api/products/1 HTTP/1.1 Host: localhost.:21069 <strong>Accept</strong>: application/json, text/javascript, */*; q=0.01 In response, the server might send: HTTP/1.1 200 OK <strong>Content-Type:</strong> application/json; charset=utf-8 Content-Length: 57 Connection: Close The Accept header is used by HTTP clients to…

Continue reading