The HTTP request (and response) structure reminds us of an email structure. At first sight, we see the difference only in the first line. The first line of a request contains a method, and the first line of a response contains status line.
An HTTP request consists of the following (see Figure 14.10):
- A method: HTTP version 1.1 supports the following methods:
GET, POST, HEAD, OPTIONS, TRACE, CONNECT, PUT
, andDELETE
. ThePUT
andDELETE
methods are not always implemented. - A header: This consists of individual header fields. Every header field starts with a keyword (for example,
Host)
. A colon followed by a space terminates the keyword. After a space, the header field parameters can follow. The whole header field is always terminated by an end of line (CR+LF). Only one header field is compulsory, namely, theHost
header field. - A blank line: I.e. CR+LF twice; the first CR+LF ends the last line of a header field. (CR is a cursor return character (0D16), and LF is a new line...