Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between a content header and a header?

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"

like image 974
Space Monkey Avatar asked May 28 '15 14:05

Space Monkey


1 Answers

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:

  • Public property Allow Gets {insert text here}.
  • Public property ContentDisposition Gets or sets {insert text here}.
  • Public property ContentEncoding Gets {insert text here}.
  • Public property ContentLanguage Gets {insert text here}.
  • Public property ContentLength Gets or sets {insert text here}.
  • Public property ContentLocation Gets or sets {insert text here}.
  • Public property ContentMD5 Gets or sets {insert text here}.
  • Public property ContentRange Gets or sets {insert text here}.
  • Public property ContentType Gets or sets {insert text here}.
  • Public property Expires Gets or sets {insert text here}.
  • Public property LastModified Gets or sets {insert text here}.
like image 160
CodeCaster Avatar answered Sep 22 '22 09:09

CodeCaster