ad

Monday, 20 April 2015

HTTP the very basics

What the heck is HTTP? Well first off, it is a protocol, you ask what’s a protocol, protocol is set of rules, that something must follow! What if you it doesn’t follow it? Well it doesn’t work properly. HTTP is Hypertext Transfer Protocol. Whenever you wanna transfer something on web, you must follow the protocol/rules! And that essentially what HTTP is.

Now that we know what HTTP is lets try understanding what exactly is happening, when you open a site. Lets say you open www.example.com your client/browser will send a request to server asking, hey! I want that file.. Server will try finding a file, if it does it find it, it will send it back.

Client asking for a file is called request, and server sending file or message back is called response.

Now for example, when you open www.google.com you’re also sending server certain information, like our browser details – like user agent, telling server what browser is it, on what platform etc etc.. Then server responds back with some headers of its own.

Basic HTTP request/response structure.
First thing we see in picture is request list, and rest of it is request header. We’ve requested the page. And send some header along with it.




And here is server sending us some response headers back.


Once you've understood this, make sure to have a look at requests type tutorial, which I'll be posting soon.

Detailed information on RFC
http://tools.ietf.org/html/rfc2616#section-1

1 comment: