- Hypertext Transfer Protocol
- The Structure of an HTTP Message
- The Structure of an HTTP Request
- The Structure of an HTTP Response
- Testing an HTTP Connection
- Passing Request Parameters
- Client Page Caching
- URI Redirection and Page Refresh
- Persistent Connections
- Using HTTP from Within a Java Program
- Summary
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.
NOTE
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.