Information Technology Reference
In-Depth Information
Fig. 2.1 An HTTP request
from a client
GET /index.html HTTP/1.0
User-Agent: Mozilla/5.0
Accept: */*
Host: www.example.org
Connection: Keep-Alive
These methods have a list of headers that specify some information that may be
used by the server to determine the response .The request is the method used by the
agent and the headers, along with a blank line and an optional message body .
The methods in HTTP are HEAD, GET, POST, PUT, DELETE, TRACE,
OPTIONS, and CONNECT. We will only be concerned with the most frequently
used HTTP method, GET. GET is informally considered 'commitment-free,' which
means that the method has no side effects for either the user-agent or the server,
besides the receiving of the response (Berners-Lee et al. 1996). So a GET method
should not be used to change the state of a user-agent, such as charging someone for
buying a plane ticket to Paris. To change the state of the information on the server
or the user-agent, either PUT (for uploading data directly to the server) or POST
(for transferring data to the server that will require additional processing, such as
when one fills in a HTML form) should be used. A sample request to http:///www.
example.org from a Web browser user-agent is given in Fig. 2.1 .
The first part of an HTTP response from the server then consists of an HTTP
status code which is one of a finite number of codes which gives the user-agent
information about the server's HTTP response itself. The two most known status
codes are HTTP 200, which means that the request was successful, or 404, which
means the user-agent asked for data that was not found on the server. The first digit
of the status code indicates what general class of response it is. For example, the
200 series ( 2xx ) response codes mean a successful request, although 206 means
partial success. The 4xx codes indicate that the user-agent asked for a request that
the server could not fulfill, while 1xx is informational, 3xx is redirectional, and
5xx means server error. After the status codes there is an HTTP entity which is
the information transferred as the payload of a request or response ” (Fielding
et al. 1999). This technical use of the word 'entity' should be distinguished from
our earlier use of the term 'entity' like the Eiffel Tower which can only be realized
by the thing itself, not in another realization. In order to do so, we will take care
to preface the protocol name 'HTTP' before any 'HTTP entity,' while the term
'entity' by itself refers to the philosophical notion of an entity. An HTTP entity
consists of “entity-header fields and...an entity-body” (Fielding et al. 1999) An
HTTP response consists of the combination of the status code and the HTTP entity .
These responses from the server can include an additional header, which specifies
the date and last modified date as well as optional information that can determine if
the desired representation is in the cache and the content-type of the representation.
A sample HTTP response to the previous example request, excluding the HTTP
entity-body, is given in Fig. 2.2 .
In the HTTP response, an HTTP entity body is returned. The encoding of
the HTTP entity body is given by the HTTP entity header fields that specify its
Search WWH ::




Custom Search