Hypertext Transfer Protocol (HTTP) : Gurjot Singh Revti Raman Singh Ug201113013 Ug201110026
Hypertext Transfer Protocol (HTTP) : Gurjot Singh Revti Raman Singh Ug201113013 Ug201110026
Protocol (HTTP)
5
HOW HTTP WORKS? (CONT.)
6
HOW HTTP WORKS? (CONT.)
7
HOW HTTP WORKS? (CONT.)
8
HOW HTTP WORKS? (CONT.)
9
PERSISTENT AND NON-PERSISTENT CONNECTIONS
10
HTTP REQUEST MESSAGE
• The first line of an HTTP request message is
called the request line; the subsequent lines are
called the header lines. The request line has
three fields: the method field, the URL field, and
the HTTP version field. The method field can take
on several different values, including GET, POST,
HEAD, PUT, and DELETE etc. The great majority
of HTTP request messages use the GET method.
The GET method is used when the browser
requests an object, with the requested object
identified in the URL field.
11
REQUEST METHODS
13
SOME COMMON STATUS CODES AND
ASSOCIATED PHRASES
• Some common status codes and associated phrases
include:
• 200 OK: Request succeeded and the information is
returned in the response.
• 301 Moved Permanently: Requested object has been
permanently moved; the new URL is specified in Location:
header of the response message. The client software will
automatically retrieve the new URL.
• 400 Bad Request: This is a generic error code indicating
that the request could not be understood by the server.
• 404 Not Found: The requested document does not exist
on this server.
• 505 HTTP Version Not Supported: The requested HTTP
protocol version is not supported by the server.
14
15
16
USER-SERVER INTERACTIONS: COOKIES
• HTTP server being stateless, simplifies server design and has permitted engineers to
develop high-performance Web servers that can handle thousands of simultaneous
TCP connections. However, it is often desirable for a Web site to identify users, either
because the server wishes to restrict user access or because it wants to serve content
as a function of the user identity. For these purposes, HTTP uses cookies. Cookies
allow sites to keep track of users.
• The cookie technology has four components:
• a cookie header line in the HTTP response message
• a cookie header line in the HTTP request message
• a cookie file kept on the user’s end system and managed by the user’s browser
• a back-end database at the Web site
17
18
WEB CACHING