Hypertext transfer protocol (HTTP) is designed to enable communications between client and server.
Do you know that there are various HTTP Methods? The few methods are
Let us know about the most commonly used HTTP methods.
The GET Method
GET is used to request data from a specified resource or server. We can able to see get request in the URL which is decrypted.
The best example is, whatever we are typing in Google to fetch the information comes under get method.
Some other features of GET requests are:
- It remains in the browser history.
- It can be bookmarked.
- It can be cached.
- It has length restrictions.
- It should never be used when dealing with sensitive data.
- It should only be used for retrieving the data.
The POST Method
The POST is used to send the data to the server to create or update the resource which is encrypted.
The username and password whichever we are entering to log-in into Facebook or Gmail can be considered as an example for post method.
Some other features of POST requests are:
- These requests cannot be bookmarked.
- This request has no restrictions on the length of data.
- This request is never cached.
- This request does not remain in the browser history.
Hope, you all got an idea on get and post method which will be more useful in programming.