Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
HTTP Header Content-Length question?
Im capturing traces using WireShark and I have a question about the basic syntax for the items in the header (Content-Length, Accept, Host, etc).
The syntax I see is:
Content-Length: 10/n/r for example
Are the fields case sensitive (must be as above) or can it be:
content-length: 10
Also is the space between the : and the length (10) required or can it be:
Content-Length:10
I need to parse these fields and I need to know this.
1 Answer
- djbckrLv 57 years agoFavorite Answer
The general rule is that:
- a sender should send well-formed data
- a receiver should accept and parse imperfect data within reason
The headers *should* be in the proper case, then a colon (:) then a space, then the header value. Most sites honor this, but you can't necessarily absolutely rely on it.
So, short answer: accept everything within sensible boundaries.
Examples from W3C: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14....
Examples from Wikipedia: http://en.wikipedia.org/wiki/List_of_HTTP_header_f...