The web and HTTP
three fields of the request line
method field, URL, and HTTP version field
headers
predefined informational fields (ex: resource location, browser information, cookies)
Status Codes - 300s
redirection
primary goals for HTTP/2
reduce perceived latency by enabling request and response multiplexing over a single TCP connection, provide request prioritization and server push, and provide efficient compression of HTTP header fields.
two types of HTTP messages
request messages and response messages
200 OK
request succeeded and the information is returned in the response
404 Not Found
requested document not found on this server
301 Moved Permanently
requested object has been permanently moved
Head-of-the-Line (HOL) blocking
sending all the objects in a web page over a single TCP connection
HTTP responses:
sent by servers to respond to a request
Status Codes - 500s
server errors
three sections of a HTTP response message
status line, six header lines, and entity body
status codes: 200s
success
304 Not Modified
tells the cache that it can go ahead and forward its cached copy of the object to the requesting browser
two components of a URL
the hostname of the server that houses the object and the object's path name.
entity body
the meat of the message
three fields of the status line
the protocol version field, a status code, and a corresponding status message
POST message
the user is still requesting the a web page from the server but the specific contents of the web page depend on what the user entered into the form fields.
PUT method
uplaodes new file (object) to server - completely replaces file that exists at specified URL with content in entity body of POST HTTP request message
GET method
used when the browser requests and object, with the requested object identifies in the URL field
POST method
web page often include form input - user input sent from client to server in entity body of HTTP POST request message
HEAD method
- asks for a response that's identical to the get request but without the respons body - could be used to determine the size of and object that would be retrieved without actually retrieving that object. - requests header (only) that would be returned if specified URL were requested with an HTTP GET Method
HTTP Request message
GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu Connection: close User-agent: Mozilla/5.0 Accept-language: fr
method field values
GET, POST, HEAD, PUT, and DELETE.
HTTP Request response behavior
HTTP request messages for the objects in the page to the server. The server receives the requests and responds with HTTP response messages that contain the objects. HTTP uses TCP as its underlying transport protocol (rather than running on top of UDP). The HTTP client first initiates a TCP connection with the server. Once the connection is established, the browser and the server processes access TCP through their socket interfaces.
HTTP response message
HTTP/1.1 200 OK Connection: close Date: Tue, 18 Aug 2015 15:44:04 GMT Server: Apache/2.2.3 (CentOS) Last-Modified: Tue, 18 Aug 2015 15:11:03 GMT Content-Length: 6821 Content-Type: text/html (data data data data data ...)
web servers
Implement the server side of HTTP
header lines
Subsequent lines of an HTTP request message
objects
a file that is addressable by a single URL
request line
The first line of an HTTP request message
400 Bad Request
The request could not be understood by the server
505 HTTP Version Not Supported
The requested HTTP protocol version is not supported by the server
stateless protocol
a server maintains no information about the clients (HTTP)
solution for HOL blocking
break each message into small frames, and interleave the request and response messages on the same TCP connection.
Status Codes - 400s
client error
two programs of Hypertext Transfer Protocol (HTTP)
client program and server program
web page
consists of object
HTTP
defines the structure of these messages and how the client and server exchange the messages
conditional GET
don't send object if cache has up-to-data cached version - no object transmission delay (or use of network resources)
web browsers
implement the client side of HTTP
status line
indicate that the server is using HTTP/1.1 and everything is OK
status codes: 100s
informational ("here is an update to you amazon order-seller has shipped your item")