Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

The Structure of an HTTP Message

HTTP requests and responses are text-based, and both have a similar four-part structure:

  • A single line used to denote whether the message is a request or a response

  • A variable number of header fields terminated

  • A blank line

  • The message body (if applicable)

As you will see, not every message type will have a body. The structure of requests and responses is discussed in more detail in the following sections.


HTTP is a generic protocol and refers to a uniform resource indicator (URI). A URI is a more general term than the familiar uniform resource locator (URL). Every URL is a URI, but a not all URIs are URLs. In addition to page locations, a URI can be a uniform resource name (URN) such as the mailto: prefix that can be used as a hypertext link on an HTML page.

  • + Share This
  • 🔖 Save To Your Account