tutorial, no_image, opps,

Opps - no_image

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

GET vs POST

GET - It requests the data from a specified resource

Example:

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

Feature:

  • Remains in the browser history
  • Can be bookmarked
  • Can be cached
  • Have length restrictions
  • Should never be used when dealing with sensitive data
  • Should only be used for retrieving the data

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
GET POST
Passes request parameter in URL Passes request parameter in request body
Parameters remain in browser history because they are part of the URL Parameters are not saved in browser history
Can be bookmarked Cannot be bookmarked
URL length is restricted. A safe URL length limit is often 2048 No restrictions for data length
Only ASCII characters allowed No restrictions. Binary data is also allowed
Mostly used for view purpose (e.g. SQL SELECT) Mainly use for update purpose (e.g. SQL INSERT or UPDATE)

https://www.w3schools.com/tags/ref_httpmethods.asp
https://www.diffen.com/difference/GET-vs-POST-HTTP-Requests
https://www.javatpoint.com/get-vs-post
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.