HyperText Transfer Protocol (HTTP)
Glazed over in three minutes
What the french fry is HTTP?
HyperText Transfer Protocol are the rules allowing the browser and the server to communicate through a request and response format.
Let’s walk through it.
You go to your browser, and type in http://www.google.com. This starts a conversation between your browser and many servers that handle the request. Just visiting this url initiates a GET request. What is a GET request? Get is the most used HTTP method which means that you want to get data/info/view on whatever is happening at http://www.google.com. This request is created in super strict way — meaning you have to send the request with all the information necessary for the server(s) to respond. The request contains headers, methods( like GET, POST, etc.), a body, and a URI. The body only exists if a ‘content-header’ is present. Example of what it would look like:
GET / HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36
If-Modified-Since: Tue, 23 Jan 2017 04:44:06 GMT
Since it is sent correctly, the server responds with a response string containing the initial line which includes the status code (it would be 200 O.K. in this example) and version type, header lines (with information about the server environment) and a message body if present. If the request isn’t sent in the correct format that satisfies the protocol, the server will respond with an error (3XX for redirection, 4XX for client errors, 5XX for server errors). If it is sent correctly, it could look like this:
HTTP/1.1 200 OK
Content/type: text/html; charset-UTF-8
Date: Tue, 23 Jan 2017 04:44:06 GMT
HTTP is a standard for communication on the world wide web. Remember client, server, request, response and RULES.
That’s it (for now)!