hypertext transfer protocol kyle roth mark hoover
Post on 19-Dec-2015
219 views
TRANSCRIPT
What is HTTP
● Protocol– Mainly used for accessing data on the World Wide
Web.– Similar to FTP and SMTP
● HTTP and FTP transfer files and use services of TCP● HTTP only uses one TCP connection.● HTTP and SMTP messages look similar● HTTP messages are only interpreted by the browser
– HTTP typically uses TCP, but only presumes reliable transport
– HTTP uses a request/response model
World Wide Web
● The Wold Wide Web is a distributed client/server service
● HTTP provides uniformity over requests and responses
● HTTP requests are requests for Web Documents
● HTTP responses are Web Documents
HTTP Messages
● There are two types of HTTP messages● Request Message
– Request Line– Header– Body
● Response Message– Status Line– Header– Body
Request Line and Status Line
● Request Line– Request Type– URL– HTTP Version
● Status Line– HTTP Version– Status Code– Status phrase
Request Type
● The Request type defines the type of action that the client is requesting
● GET – Requests a document from the server
● HEAD – Requests information about a document, but not the document itself
● POST – Sends some information from client to server
● PUT – Sends a document from client to server
● TRACE – Echoes the incoming request
● CONNECT – Reserved
● OPTION – Inquires about available options
URL
● Standard for specifying any kind of information on the Internet
● Defines– Protocol – HTTP– Host – Referred to by an alias (typically www)– Port – Specifies port number of the server (optional)– Path – Pathname to the file
Status Code/Phrase
● The Status code reports the success of the request– 100 Range – Informational– 200 Range – Successful request– 300 Range – Redirection– 400 Range – Client Side Error– 500 Range – Server Side Error
HTTP Header
● Header contains additional information● The header can specify format constraints● Four categories of headers
– General – Information about the message– Request – Specifies client's configuration and
preferred format– Response – Specifies server's configuration and
special information about the request– Entity – Information about the body
Nonpersistent Connections
● Persistent connections are default in HTTP version 1.1
● One connection is made for each request/response– Client opes a connection and sends a request– Server sends the response and closes the
connection– Client reads data, then closes the connection
● Requires N connections for N files
Persistent Connections
● Persistent connections remove the high overhead of non persistent connections
● The connection remains open until the client requests it to be closed, or the connection times out
● Length of data is sent when applicable
Proxy Servers
● Proxy servers act as go betweens for the actual servers
● Proxy servers maintain a cache of recent requests
● HTTP requests are sent to proxy servers, which check their cache
● The actual server is only accessed when the proxy server does not have the requested information– The proxy server polls the server for the requested
information and updates its cache