Sunday, 19 August 2012

HTTP Protocol


HTTP Protocol


  • The communication between web server and web browser on internet is done using HTTP protocol.
  • HTTP is an application level protocol.
  • HTTP is a specification by IETF (Internet Engineering Task Force).
  • HTTP Protocol is the safest protocol on internet.
  • HTTP is a stateless protocol. This is because it doesn’t know whether the request that has been made is part of an ongoing correspondence or just a single message.
  • HTTP communicates only in the String Format and is thus virus free and is platform independent.
  • HTTP protocol works on PULL technology. i.e. we can pull everything available on webserver but we cannot push content to the server unless server allows for it.

HTTP Protocol supports following Methods
1. GET
2. POT
3. PUT
4. OPTIONS
5. DELETE
6. TRACE
7. CONNECT

Of all these the most commonly used methods are "POST" and "GET"

<form name="Form1" action="demo.asp" method="post" >
                <input type="…..
                <input type="submit" name="s1" value="Submit">
</form>

When the form is submitted by clicking on the submit button it submits the Name/ Value pair of every input element in the form to the server.

Difference between GET and POST Methods:

GET Method:
  1. All the name value pairs are submitted as a query string.
  2. It’s not secured as it is visible in plain text format in the Location bar of the web browser..
  3. Length of the data submitted to server is restricted.
  4. If method is not mentioned in the Form tag, this is the default method used.
  5. If get method is used and if the page is refreshed it would not prompt before the request is submitted again.
POST Method:
  1. All the name value paris are submitted in the Message Body of the request.
  2. Length of the string (amount of data submitted) is not restricted.
  3. Post Method is secured because Name-Value pairs cannot be seen in location bar of the web browser.
  4. If post method is used and if the page is refreshed it would prompt before the request is submitted again.
In simple words, if the sumitted data changes the state of server then POST should be used otherwsie GET must be used.

For Example:
Search criteria must always be submitted using GET method because the result of search doesn't make any change to server
but if the form is like Polling for something, then it must be POST method because this will change the data on server.

You can learn more from following FREE video
http://www.bestdotnettraining.com/VideoLibrary
Please expand ASP.NET and visit Web Programming Introduciton Chapter.

No comments:

Post a Comment