Wednesday, April 20, 2011

HTTP - More...

We already are familiar with the basic idea and structure of HTTP. Well now lets move ahead... with gear 1 so no worries :)

Remember HTTP is a request/response protocol... !!! If 'no' then read the earlier post - 5 minutes of basics !!!


The key elements of HTTP request are:
> HTTP method
> URL
> Form parameters

HTTP method is nothing but the action the client wants to perform. The client may want to get something from the server or to post something to it - some data that the server can use for responding accordingly or can save it in a database for further utility. HTTP method specifies what 'action' the client performs. Basic HTTP methods are GET, POST, PUT, DELETE.

URL of course is for accessing the page the client wishes to... of the server !!!

Form parameters are some data that the client wishes to send to the server.



The key elements of HTTP response are:
> Status code
> Content - type
> Content

Status code for example can be something like 301, 302, etc... or something like 'not found', 'ok', etc...
This is information about the status of the request whether it was successful or not. So the response will tell the client the status of the request.

Content - type can be 'text', 'picture', 'html', etc... Just to specify the type of content to the client so that it can accordingly display it.

Finally the content - this is the actual text file, image or html that the server sends to the client for the request it has made.






No comments:

Post a Comment