asp.net web api - Difference between the two Web API headers response.Content.Headers and response.Headers -
i find webapi separate http response headers different places, 1 in response.headers, other in in response.content.headers. example, etag in response.headers while lastmodified in other. reason behind that?
there couple of answers question. 1 because that's way http spec defines headers.
rfc 2616
- content header fields here http://tools.ietf.org/html/rfc2616#section-7.1
- request header fields here http://tools.ietf.org/html/rfc2616#section-5.3
- response header fields here http://tools.ietf.org/html/rfc2616#section-6.2
the other more practical reason separating out content headers is easier write code processes data http payloads , sets related headers, independent of request/response objects.
unfortunately, more recent httpbis specification did reorganization of think headers should go , lastmodified , allow considered response fields, not content fields. means headers defined in system.net.httpheaders no longer match spec, sucks. means stuck lastmodified httpcontent header , etag response header.
httpbis
Comments
Post a Comment