API post vs get | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

API post vs get

If an API uses GET method, can I also use it with POST? Or do they need totally different implementation on server side?

3rd Mar 2020, 7:30 AM
Prof. Dr. Zoltán Vass
3 Answers
+ 3
depend on implementation usually yes. GET only be used to fetch the data, no data altering, no wrting, just read POST is used to send and write a new data, so usually its protected an need authorization not every api like this though
3rd Mar 2020, 7:34 AM
Taste
Taste - avatar
+ 1
Same route can be for GET and POST requests, create difference controllers to handle difference methods.
3rd Mar 2020, 8:28 AM
Calviղ
Calviղ - avatar
0
It depends on API. API like JSON placeholder gives you POST methods. But what your post will not stored in their database. I think. Most of the API does not give you permission to POST.
3rd Mar 2020, 11:00 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar