These tables contain a nearly complete list of all the methods, requests, and header fields of typical HTTP/1.0 and HTTP/1.1 requests and responses.

HTTP/1.1 Methods and Field Definitions

Method

Request

Definition

GET

GET <Request-URI>?query_string HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n\r\

The GET method is used to retrieve whatever is stored or produced by the resource located at the specified Request-URI. The GET method can be used to request files, to invoke server-side scripts, to interact with server-side CGI programs, and more. When HTML form variables are submitted with the form action set to GET, the form parameters are encoded in a query string and submitted to the HTTP server as part of the Request-URI using the GET request method.

POST

POST <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n

Content-Length: <length in bytes>\r\n

Content-Type: <content type>\r\n\r\n

<query_string or other data to post to Request-URI>

The POST method is used to submit data to the resource located at the specified Request-URI. Typically, the resource located at the specified Request-URI is a server-side script or CGI program designed to processes form data. When HTML form variables are submitted with the form action set to POST, the form parameters are encoded and submitted to the HTTP server as the body of the POST request message.

HEAD

HEAD <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n\r\n

"The HEAD method is identical to the GET method except that an HTTP 1.1 server should not return a message-body in the response. The meta-information contained in the HTTP headers in response to a HEAD request should be identical to the information sent in response to a GET request. This method can be used for obtaining meta-information about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification."—Section 9.4, RFC 2616.

PUT

PUT <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n

Content-Length: <length in bytes>\r\n

Content-Type: <content type>\r\n\r\n

<data to put to file>

The PUT method allows for data to be transferred to an HTTP server and stored at the location identified by the Request-URI.

OPTIONS

OPTIONS <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n\r\n

"The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI." —Section 9.2, RFC 2616.

DELETE

DELETE <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n\r\n

"The DELETE method requests that the origin server delete the resource identified by the Request-URI."—Section 9.7, RFC 2616.

TRACE

TRACE <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n\r\n

"The TRACE method is used to invoke a remote, application-layer loop-back of the request message…. TRACE allows the client to see what is being received at the other end of the request chain and use that data for testing and diagnostic information."—Section 9.8, RFC 2616.

CONNECT

CONNECT <Request-URI> HTTP/1.1\r\n

Host: <hostname or IP address of host>\r\n\r\n

The CONNECT message type is used to specify a proxy connection to the resource identified by the Request-URI.

 

Table B-2. HTTP/1.0 Methods and Field Definitions

Method

Request

Definition

GET

GET <Request-URI>?query_string HTTP/1.1\r\n\r\n

The GET method is used to retrieve whatever is stored or produced by the resource located at the specified Request-URI. The GET method can be used to request files, to invoke server-side scripts, to interact with server-side CGI programs, and more. When HTML form variables are submitted with the form action set to GET, the form parameters are encoded in a query string and submitted to the HTTP server as part of the Request-URI using the GET request method.

POST

POST <Request-URI> HTTP/1.1\r\n\

Content-Length: <length in bytes>\r\n

Content-Type: <content type>\r\n\r\n

<query_string or other data to post to Request-URI>

The POST method is used to submit data to the resource located at the specified Request-URI. Typically, the resource located at the specified Request-URI is a server-side script or CGI program designed to processes form data. When HTML form variables are submitted with the form action set to POST, the form parameters are encoded and submitted to the HTTP server as the body of the POST request message.

HEAD

HEAD <Request-URI> HTTP/1.1\r\n\r\n

"The HEAD method is identical to the GET method except that an HTTP 1.1 server should not return a message-body in the response. The meta-information contained in the HTTP headers in response to a HEAD request should be identical to the information sent in response to a GET request. This method can be used for obtaining meta-information about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification."—Section 9.4, RFC 2616.

 

Table B-3. HTTP/1.0 Undefined Method Description as Found in Appendix D of RFC 1945.

Method

Request

Definition

PUT

The PUT message format is not defined in RFC 1945. In practice, the PUT message format is the same as for HTTP 1.1.

The PUT method allows for data to be transferred to an HTTP server and stored at the location identified by the Request-URI.

DELETE

The DELETE message format is not defined in RFC 1945. In practice, the DELETE message format is the same as for HTTP 1.1.

"The DELETE method requests that the origin server delete the resource identified by the Request-URI."— Appendix D.1, Section D.1.2, RFC 1945.

LINK

The LINK message format is not defined in RFC 1945 and is not implemented by most/all HTTP 1.0 implementations.

"The LINK method establishes one or more Link relationships between the existing resource identified by the Request-URI and other existing resources."— Appendix D.1, Section D.1.3, RFC 1945.

UNLINK

The UNLINK message format is not defined in RFC 1945 and is not implemented by most/all HTTP 1.0 implementations.

"The UNLINK method removes one or more Link relationships from the existing resource identified by the Request-URI."— Appendix D.1, Section D.1.4, RFC 1945.