display | more...
An HTTP request line is a single line of data that an HTTP client sends to a server when requesting a document.

Syntax:

(request-method) (URI) HTTP/(version)

Examples:

GET / HTTP/1.0
GET /~docs/tutorial.pdf HTTP/1.0
GET /profiles/john.html HTTP/1.0
POST /cgi-bin/name HTTP/1.0

(request-method)

The request method tells the server what the client wants it to do. There are three different request methods supported under HTTP 1.0.

GET
This is the most common request method. The GET method tells the server that the client wants a document. When you type http://www.everything2.com into the address bar your browser connects to port 80 of www.everything2.com and issues the request line GET / HTTP/1.0.

HEAD
Similar to GET however the server will only send the response headers, not the actual document. Among it's many uses are:


POST
This method is used to tell the server that it will be recieving data for a CGI program. The client sends a request line (using the POST method..duh.), followed by a content-length line, any other HTTP headers, a blank line, and finally the data to be processed by the CGI program.

(URI)

The URI in this case is a partial URI. It is the path from the server to the file that the client is requesting. It will be theURL with the protocol, host, and port number stripped off.

URL:  http://ret004l9.eresmas.net/bigfeet/bigfeet.html
partial URI:  /bigfeet/bigfeet.html

(version)

The HTTP version being used on the server. Generally this will be 1.0 however more and more servers are supporting HTTP 1.1.

Log in or register to write something here or to contact authors.