HTTP header and message body separator clarification

RFC 2616 (which you shouldn't look at anymore, 7230 is its successor) states:

   generic-message = start-line
                      *(message-header CRLF)
                      CRLF
                      [ message-body ]

So there's:

  1. The start-line, which is either a Request-Line or a Status-Line, both of which end in CRLF.
  2. Zero or more message-headers, each ending in CRLF.
  3. A CRLF to denote the end of the start-line and headers.
  4. Optionally, a message body.

That being said, you don't want to parse HTTP yourself. Use a library for that.

Example enter image description here (picture source)