Reputation: 143
HttpRequestMessage
Has Content.Headers and Headers
Why is that? when I google Http protocol online, I don't see anyone mentioning a content header and a normal header, there are only "headers"
Upvotes: 14
Views: 3795
Reputation: 2317
From what I can tell, content headers come into play when you are dealing with MultipartContent or MultipartFormDataContent. The example in this blog post explicity applies a "Content-Type" header at the content level.
Upvotes: 0
Reputation: 151690
Unfortunately, the MSDN documentation for MVC, WebAPI and System.Net.Http are appaling. See HttpContentHeaders.ContentType Property:
Gets or sets {insert text here}.
Well-known content-specific headers are grouped under "content headers". It's just for convenience. There are headers like content-type
, content-length
, and so on, as seen in HttpContentHeaders Class:
Upvotes: 11