Part 143 Difference between http get and http post methods

  • دعنا نشارك هذا :
ترتيب الدرس : 143
المدة : 00:11:13
التحكم :
Text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.


All ASP .NET Text Articles

All ASP .NET Slides

ASP.NET Playlist

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

HTTP stands for Hypertext Transfer Protocol. Http is the most common protocol used for communication between a web server and a client. For example, to request home page of Pragim Technologies, you would type the following URL. Notice that the URL has http prefix.

The 2 most commonly used HTTP methods are GET and POST.

Build the solution. Open a browser window. In the Address bar type the following address and press and enter key.

So here we are issuing a GET request for WebForm1.aspx. In the fiddler tool, you can clearly notice that a GET request is issued for WebForm1.aspx

At this point, you will have the user interface to enter FirstName, LastName and Email. Enter the details and when you click "Submit" button, the data will be posted to the server. So, here we are issuing a POST request to submit the data on WebForm1.aspx. In the fiddler tool, you can clearly notice that a POST request is issued to submit WebForm1 data.

In the Button1_Click() event handler, we have Response.Redirect() call, which issues a GET request to WebForm2.aspx

GET Request - GET Request is generally used to get data from the web server. A GET request is generally issued,
1. When you click on a hyperlink
2. When Response.Redirect() statement is executed
3. When you type URL in the address bar and hit enter

POST Request - POST request is generally used to submit data to the server. A POST request is generally issued,
1. When you click on a submit button
2. When AUTOPOST back is set true and when a selection in the DropDownList is changed

Difference between GET and POST method
1. GET method appends data to the URL, where as with the POST method data can either be appended to the URL or in the message body.
2. As GET request rely on querystrings to send data to the server, there is a length restriction, where as POST requests have no restrictions on data length.
3. While it is possible to change the state of data in database using GET request, they should only be used to retrieve data.

In webforms, IsPostBack page property is used to check if the request is a GET or a POST request. If IsPostBack property returns true, then we know the request is GET, else the request is POST.

سيتم تفعيل التعليقات قريبا

Sep 23, 2020 07:32:26