Greetings readers! We are continuing our "Understanding HTTP Protocol" series. Today we will dwell more into request and response messages, what are they made up of, and understand the basic scenario behind their working.
HTTP Message Format |
I'm assuming you have a basic understanding of HTTP and HTTP Messages (Request and Response). If not, then refer to the first article :
Understanding HTTP Protocol | Request and Response Messages
HTTP Message Format
The communication takes place through HTTP Messages - made up of Request and Response. These messages are text based only.
Every standard HTTP Message is made up of the following parts :
<start-line> <message-headers> <empty-line> [<message-body>]
- <start-line> : Conveys the nature of the message being sent or received. That is, whether it is a request message or a response message.
- <message-headers> : <header-name>:<header-value> Core part of HTTP Messages.
- <empty-line> : An empty line separates header and body content.
- <message-body> The content of the message to sent or received.
Request Message Format
<request-line>
<request-headers>
<empty-line>
[<message-body>]
<request-line> <request-headers> <empty-line> [<message-body>]
Response Message Format
<status-line>
<response-headers>
<empty-line>
[<message-body>]
<status-line> <response-headers> <empty-line> [<message-body>]
HTTP response message |
These text based messages contain few elements only, however it is essential to understand the working of these individual elements. HTTP messages contain some very vital information about the sender and receiver in the form of HTTP Headers. These will be described in the later sections of this series of tutorials.
Disclaimer : The illustrations used in this article are not owned by Binhacker and are used only for fair use only.