HTTP message body

HTTP message

The request/response message consists of the following:

  • Request line, such as GET /logo.gif HTTP/1.1 or Status line, such as HTTP/1.1 200 OK,
  • Headers
  • An empty line
  • Optional HTTP message body data

The request/status line and headers must all end with <CR><LF> (that is, a carriage return followed by a line feed). The empty line must consist of only <CR><LF> and no other whitespace.

The "optional HTTP message body data" is what this article defines.

Response example

This could be a response from the web server:

HTTP/1.1 200 OK
Date: Sun, 10 Oct 2010 23:26:07 GMT
Server: Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8 OpenSSL/0.9.8g
Last-Modified: Sun, 26 Sep 2010 22:04:35 GMT
ETag: "45b6-834-49130cc1182c0"
Accept-Ranges: bytes
Content-Length: 12
Connection: close
Content-Type: text/html

Hello world!

The message body (or content) in this example is the text Hello world!.

gollark: Actually, I worship all possible gods in equal amounts.
gollark: (μahahaha)
gollark: If I got to pick the game, it would be Factorio or something, and also I would have several hours of lead time.
gollark: The modern version would probably be "1v1 me in [COMPUTER GAME OF SOME KIND]".
gollark: Current Discord culture does not really care.

See also


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.