Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

• HTTP type of protocol, it is a Hypertext Transfer Protocol

allows primarily allows web document to be


communicated over the network.
• HTTP server and the HTTP browser
• HTTP browser are clients like our Internet Explorer or
Mozilla or Chrome or anything, any browser which are a
primarily HTTP client
• HTTP server :It can be in the same machine, can be in the
same network, can be in a different network, different
machine and anything . The only thing is that it should
have some sort of connectivity between the thing

HTTP 1
Client (Browser)

• A variety of vendors offer commercial browsers that interpret and


display a Web document,and all use nearly the same architecture.
• Each browser usually consists of three parts: a controller, client
protocol, and interpreters.
• The controller receives input from the keyboard or the mouse and
uses the client programs to access the document.
• After the document has been accessed, the controller uses one of
the interpreters to display the document on the screen. The
interpreter can be HTML, Java, or JavaScript, depending on the
type of document
• The client protocol can be one of the protocols such as FTP or
HTTP.

HTTP 2
Server

The Web page is stored at the server. Each time a


client request arrives, the corresponding
document is sent to the client. To improve
efficiency, servers normally store requested
files in a cache in memory; memory is faster to
access than disk. A server can also become
more efficient through multithreading or
multiprocessing. In this case, a server can
answer more than one
HTTP 3
HTTP 4
URL and HTTP
• All parts of URL, except parameters, used with
http
• Scheme and host can be omitted when
referenced object is on same machine as
referring document
• Port can be omitted so long as referenced host
is running on port listed in your /etc/services
file
– Usually port 80
HTTP 5
Uniform Resource Locator
• A client that wants to access a Web page needs the address. To facilitate the access of
documents distributed throughout the world, HTTP uses locators.
• The uniform resource locator (URL) is a standard for specifying any kind of information
on the Internet.
• The URL defines four things: protocol, host computer, port, and path.

• The protocol is the client/server program used to retrieve the document. Many
different protocols can retrieve a document; among them are FTP or HTTP. The most
common today is HTTP.
• The host is the computer on which the information is located, although the name of the
computer can be an alias. Web pages are usually stored in computers, and computers
are given alias names that usually begin with the characters "www".
• The URL can optionally contain the port number of the server. If the port is included, it
is inserted between the host and the path, and it is separated from the host by a colon.
• Path is the pathname of the file where the information is located. Note that the path can
itself contain slashes that, in the UNIX operating system, separate the directories from
the subdirectories and files.
• An HTTP cookie is a small piece of data HTTP
sent from a website and stored in a user's web 6
HTTP Request/Response Messages
• Request line / Status line
• Headers
• blank line
• body ( present only in some message)
• Request line: request type URL HTTP version
Status line: HTTP version status code status
phrase

HTTP 7
HTTP ver.
• HTTP 1.0 that is RFC 1945 specified.
• HTTP 1.1 ……RFC 2616
• transport independence
• HTTP comes by default with the TCP connection
• HTTP can support multiple request reply exchanges over a single TCP
connection
• Default port is port 80 , but other ports can be used

HTTP 8
HTTP methods.
• GET : which request a document from the server
• HEAD: requests information about a
document but not the document itself
• POST: sends some information from
the client to the server
• PUT: sends a document from the server to the client
• TRACE: echoes incoming request
• CONNECT: is reserved method
• OPTION: that inquires about the available options

HTTP 9
Status code
• 100 : continue …..initial part of the request has been
received, the client may continue with the request
• 101 : switching….. the server is complying with a client
request to switch protocols defined in the upgrade header
• 2xx series :200- OK, the request is successful; 201 -
created; 202- accepted; 204 -no content in the body
• 3xx series : Redirection
• 4xx series: Clint error
• 5xx series: Server error

HTTP 10
HTTP 1.0
• HTTP response
– Status line
• Status-codes 3xx - Redirection
– Further action must be taken in order to complete request
» 300 Resource found at multiple locations
» 301 Resource moved permanently
» 302 Resource moved temporarily
» 304 Resource has not modified (since date)

HTTP 11
HTTP 1.0
• HTTP response
– Status line
• Status-codes 4xx - Client error
– The request contains bad syntax or cannot be fulfilled
» 400 Bad request from client
» 401 Unauthorized request
» 402 Payment required for request
» 403 Resource access forbidden
» 404 Resource not found
» 405 Method not allowed for resource
» 406 Resource type not acceptable

HTTP 12
HTTP 1.0
• HTTP response
– Status line
• Status-codes 5xx - Server error
– The server failed to fulfill an apparently valid request
» 500 Internal server error
» 501 Method not implemented
» 502 Bad gateway or server overload
» 503 Service unavailable / gateway timeout
» 504 Secondary gateway / server timeout

HTTP 13
HTTP header
• header name colon a space and the header value.
• Cache control: specify informational
information about the cache caching;
• Connection: shows whether the connections
would be closed or not;
• Date: current date;
• MIME: upgrade
• Many more….

HTTP 14
Request header
• Accept
• Accept-charset
• Accept encoding
• Many more….

• User Agent…
HTTP 15
HTTP Entity headers
• valid methods
• content encoding
• content length, content range,content type, when
it expires, last modified date, location specifies
the location of the created or modified document

HTTP 16
HTTP 1.0
• Berners Lee, Fielding, Nielsen - 1995
• Used in hypermedia systems distributed
across networks
• Defines request-response conversation
– Requesting program (client) establishes
connection with receiving program (server)
– Client sends request to server
• HTTP specifies syntax

HTTP 17
HTTP 1.0
• HTTP request
– Method
– URI
– Protocol version
– Optional other information
– Method [Request URI] HTTP/1.0 <CRLF>

HTTP 18
HTTP 1.0
• Method
– Get
• Returns object
– Head
• Returns information about object
– Post
• Sends information to be stored on server or as input to
script

HTTP 19
HTTP 1.0
• Method
– Put
• Sends new copy of existing object to server
• Usually not allowed
– Delete
• Deletes object
• Usually not allowed

HTTP 20
HTTP 1.0
• Other information
– User Agent
• Kind of browser
– If-Modified-Since
• Returns object only if more recent than given date
• Otherwise returns status code 304

HTTP 21
URL and HTTP
• Full path used when referring to another
server
– Relative path on same server
• Reference with relative path is a partial URL
• Query passes parameters to CGI
• Fragment jumps to labels within a page
– http://www.x.y/z#foo

HTTP 22

You might also like