Notes

HTTP

Back to networking page


What is HTTP?

Hyper Text Transfer Protocol The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser.

Development of HTTP was initiated by Tim Berners-Lee at CERN in 1989. Development of early HTTP Requests for Comments (RFCs) was a coordinated effort by the Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C), with work later moving to the IETF.

Runs on port 80. TCP is used. Stateless protocol so cookies are used.


Why HTTP is used?

HTTP is used to tranfer data which is in form of web pages and many more things. Internet basically runs on HTTP protocol.


URL

Uniform Resource Locator i.e URL is way of specifying how , where and what information to get.

URL : Method :// Host : Port / Path

Example : http://www.w4.org/hypertext/www/project.html


Cookies

Cookies are used because http is stateless protocol. It can’t identify the client. Cookies are simple information packets that can identify user. set-cookie is method used to create cookie. Cookies are controversial as they invade privacy.


Web documents

  1. Static documents : Simple HTTP pages with information
  2. Dynamic documents : Document created on server based on clients input or authentication.
  3. Active documents : This document will run of clients browser for example gif , animated graphics. Browser is responsible to manage and execute this files.

Request methods

An HTTP/1.1 request made using telnet. The request message, response header section, and response body are highlighted.

The HTTP/1.0 specification defined the GET, HEAD and POST methods, and the HTTP/1.1 specification added five new methods: PUT, DELETE, CONNECT, OPTIONS, and TRACE.

Method names are case sensitive This is in contrast to HTTP header field names which are case-insensitive.

All general-purpose HTTP servers are required to implement at least the GET and HEAD methods, and all other methods are considered optional by the specification.

http


Status code

A basic breakdown of the status codes is:

100-199: Information 200-299: Successes (200 OK is the “normal” response for a GET) 300-399: Redirects (the information you want is elsewhere) 400-499: Client errors (You did something wrong, like asking for something that doesn’t exist) 500-599: Server errors (The server tried, but something went wrong on their side)

Check more detailed status code here ….


HTTP versions


HTTP Problem


Sources :