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

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

  • content related headers defined here.
  • request headers here.
  • response headers here.

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -