Difference between GET and POST Method

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Http protocol supports the following methods to retrieve data such as get, post, put, delete etc. In this article, I will tell you about the difference between GET and POST methods.
These methods are basically used to get and send any data. Because of these methods, the request-response between server and client exist. To send data streams we use these two methods. GET and POST are the most common HTTP methods.
Difference between GET and POST Method

Image Source
GET
POST
We add parameters in URL and get data in response.
Send additional data from the client or browser to the server.
Sends data as part of URI (uniform resource identifier)
Sends data as HTTP content.
get return same results every time.
The post method implements in that way it changes with every request.
We can send limited data in the header.
 
We can send a large amount of data because its part of the request body.
It is not much secure because data is exposed to URL and we can easily bookmark it and send it.
 
It  is more secure because data is passed in the request body and user not able to bookmark it
You can cache the data.
You cannot cache post request data.
GET is bounded by the max. URL length continued by the browser and web server.
POST doesn’t have such conditions.
GET is used to request data from a particular resource.
POST is used to send info to a server to create/update a resource.
parameters passed  in URL
parameters passed in body
This is not happening in get method.
Use POST for destructive things such as creation, editing, and deletion.
get is used for fetching documents.
post used for updating data.
in get we pass things like customer id, uId to get a response.
post request sends information to server like customer info, file upload etc.
Check out the example of both requests.
GET Request:
GET https://api.github.com/users/{name}
Here you can pass name according to that you will get data.
GET https://api.github.com/users/seeschweiler
POST Request:
In this you will have to send content-type such as multipart/form-data, application/json,  application/x-www-form-urlencoded and object or data that you have to pass in body.
Host: foobar.example
Content-Type: application/json
Object- [{name1:value1},{name2:value2}]
In this you are posting JSON data to API.
Comment down below if you have any queries related to get vs post methods.
The post Difference between GET and POST Method appeared first on The Crazy Programmer.

X ITM Cloud News

Emily

Next Post

Height and Depth of Binary Tree

Sun Nov 24 , 2019
Spread the love          In this tutorial, we will learn how to find height and depth of binary tree with program implementation in C++. It is one of the most commonly used non-linear data structures. We will learn about: What is the height of a binary tree? Algorithm and implementation for finding […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM