aspdotnet_get_post.md - brainchildservices/curriculum GitHub Wiki

Slide 1

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

Slide 2

The HTTP GET method requests a representation of the specified resource. Requests using GET should only be used to request data (they shouldn't include data).

Extra Notes:

  • GET requests can be cached
  • GET requests remain in the browser history
  • GET requests can be bookmarked
  • GET requests should never be used when dealing with sensitive data
  • GET requests have length restrictions
  • GET requests are only used to request data (not modify)

Slide 3

GET Method Example:

 GET/RegisterStudent.asp?user=value1&pass=value2  

032020_0831_GETvsPOSTKe1

Slide 4

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 Dropdown List is changed

    • Extra Notes:
      • POST requests are never cached
      • POST requests do not remain in the browser history
      • POST requests cannot be bookmarked
      • POST requests have no restrictions on data length

Slide 4

POST Method Example:

                    POST/RegisterStudent.asp HTTP/1.1  
                    Host: www.guru99.com  
                    user=value1&pass=value2

032020_0831_GETvsPOSTKe2

Slide 5

  • 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.

Ref Link:

https://www.w3schools.com/tags/ref_httpmethods.asp

https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET

https://www.guru99.com/difference-get-post-http.html