A request from a client to a server includes the following information:
Request method
Request header
Request data
A client can request information using a number of methods. The commonly used methods include the following:
POST—Requests that the server accept some data from the client, such as form input for a CGI program
PUT—Replaces the contents of a server’s document with data from the client
The client can send header fields to the server. Most are optional. Some commonly used request headers are shown in Request Header.
Table B–1 Common request headers
Request header |
Description |
---|---|
The file types the client can accept. |
|
Used if the client wants to authenticate itself with a server; information such as the username and password are included. |
|
The name and version of the client software. |
|
The URL of the document where the user clicked on the link. |
|
The Internet host and port number of the resource being requested. |
If the client has made a POST or PUT request, it can send data after the request header and a blank line. If the client sends a GET or HEAD request, there is no data to send; the client waits for the server’s response.