I hate to ask a question with such little merit, considering it’s documented, but I was wondering if someone could give me a hand in understanding the terminology behind HTTP. I know I could just read the documents, but sometimes it feels a little thick and it’s hard to understand what they’re trying to say.
Here’s what I’m getting so far:
The entire transaction consists of messages, which are either Requests or Responses.
Start line?
[method/verb] [url?] [version?]
GET / HTTP/1.1\r\n
A message header
[name]: [value (which is LWS and content)]
Host: google.com\r\n
\r\n
—
[version?] [status code] [description?]
HTTP/1.1 200 OK\r\n
Content-type: text/plain\r\n
Transfer-Encoding: chunked\r\n
\r\n
Message body?
d\r\n
Hello, world!\r\n
0\r\n
\r\n
(and, the entity body would just be “Hello world!” / the version of the message body sans encoding? Or, would it only be a ‘message body’ as opposed to an entity body if it were encoded?)
I appreciate any notes/insight/corrections you may have. I’m currently attempting to write an HTTP engine, so I feel it’s worth the investment to ensure proper terminology is used. Thank you for reading.
All of this terminology can be found in the RFC documents from IETF. Specifically, you’re interested in RFC 2616. If you’re writing your own HTTP engine, reading at least RFC 2616 is a must, along with RFCs 1738, 1808 and 2396.
Here are some relevant excerpts that answer your questions: