Pages

Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Friday, October 22, 2010

More About HTTP

  • HTTP is the Protocol for WWW.
  • HTTP is a stateless protocol.
  • HTTP provides 04 methods to interact with a web resource.
  • Get 
    • (Call to get a resource, Cacheable, Idempotent)
  • Put 
    • (Call to Update a resource if exists. Create otherwise, Idempotent)
  • Post 
    • (Specification not provided)
  • Delete 
    • (Call to Delete a resource, Idempotent)



Share/Bookmark

Response Header Fields

The first line of the server’s response contains a status code



200 OK                             request was processed successfully

301 Moved permanently      document has been moved

304 Not modified                if cached version is up-to-date

400 Bad request                 syntax error in client’s request

403 Forbidden                    client is not allowed access (e.g., protected)

404 Not found                    file could not be found

500 Internal server error      server failed

503 Service unavailable       server is overloaded

In addition to the status code, the server’s response may include



Date  response time (in GMT)


Server  identification info on the server


Last-modified  time document was last changed (in GMT)


Content-length  size of document, in bytes


Content-type  file format (e.g., html, gif, pdf)


Expires  prevents browser from caching beyond date

Share/Bookmark

GET Request

Most URL’s (Uniform Resource Locator) have the form:    


                  protocol://serverName URI 


e.g., http://www.csc.liv.ac.uk/~martin/index.html


To retrieve a document via HTTP from the server, we can issue a GET request using the HTTP protocol


                               GET URI HTTP/1.1
                               Host: serverName

Web server only knows the contents of the GET request message

  • this request is automatically generated by browser when you select a URL
  • could also come from a link checker, a search engine robot, …
  • can come directly from a telnet connection using port 80

Share/Bookmark

Hyper Text Transfer Protocol (HTTP)

  • Hypertext Transfer Protocol (HTTP):
    • application-level protocol for distributed, collaborative, hypermedia information systems
    • generic, stateless, object-oriented
    • can be used for many tasks, such as name servers & distributed object management systems
    • underlying language of the Web
  • HTTP/1.0 allows only connectionless message passing
    • each request/response requires a new connection
    • to download a page with images requires multiple connections
      • can overload the server, require lots of overhead
  • HTTP/1.1 provides persistent connection by default
    • once client & server connect, remains open until told to close it (or timeout)
    • reduces number of connections, saves overhead
    • client can send multiple requests without waiting for responses
      • e.g., can request all images in a page at once

Share/Bookmark
Related Posts Plugin for WordPress, Blogger...

Popular Posts

Share |