tutorial, no_image, opps,

Opps - no_image

Upendra Upendra Follow Jan 23, 2025 · 1 min read
Opps - no_image
Share this

PUT vs POST

PUT - It is used to send data to a server to create/update a resource.

Example:

http://www.google.com/users/234

PUT /new.html HTTP/1.1
Host: example.com
Content-type: text/html
Content-length: 20

<p>New File</p>

Feature:

  • Cannot be bookmarked
  • Should only be used for update the data
  • Never cached
  • Do not retain in the browser history

POST - It submits the processed data to a specified resource Example:

https://api.themoviedb.org/3/movie/1/rating

RequestBody
{
  "value": 8.5
}

Feature:

  • Cannot be bookmarked
  • Have no restrictions on length of data
  • Never cached
  • Do not retain in the browser history
PUT POST
Is idempotent Is not idempotent
If you send the same request multiple times, the result will remain the same If you send the same POST request more than one time, you will receive different results
Mostly used for UPDATE query Mainly use for create query

https://www.keycdn.com/support/put-vs-post
https://restfulapi.net/rest-put-vs-post/
https://www.guru99.com/put-vs-post.html
https://developers.themoviedb.org/3/movies

credit goes to @swayangjit
Join Newsletter
Get the latest news right in your inbox. We never spam!
Upendra
Written by Upendra Follow
Hi, I am Upendra, the author in Human and machine languages,I don't know to how 3 liner bio works so just Connect with me on social sites you will get to know me better.