Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669015yI came to say yes... but then I spotted who's rant this is and this just feels awkward.
Get -> get me data
Post -> create new data
Put -> update data
Delete -> well can't say I've had an actual use for this guy. -
I have used them all for CRUD interfaces yes.
Pet peeve of mine is when people do this:
HTTP GET https://....../getRecords
Whatever you do, don’t do that -
vane110525yIn the ancient times of internet ( <5 years ๐) you want to support ie7 and 8 and those don’t support PUT and DELETE methods.
Actually REST is pretty young approach.
I recommend you to read OpenAPI(swagger) spec on how to build REST api.
And yeah I use all of those methods but want to switch to GraphQL. -
@C0D4 Hey, Its you again. Who said life is gonna be easy?
Anyway I have been only using get and post for my calls. delete apis with post, update apis with post.
I wonder why i have to use put,delete,update requests if i allready can do it with Post.
Let me check the docs. -
C0D4669015y@sandeepbalan yes you can delete over a post, the method it's self doesn't prevent you, doesn't make it the right way to do it.
-
Hazarth95375yI use all of those + PATCH. It barely matters to us as BE developers, hell you can even put post data into a get request and some frameworks will eat it up without question. But following standards is not for us, its for the next guy/gal, the testers, the FE devs, mobile app devs, and anyone attaching their clients to our APIs. If we follow standards to our best abillity we're gonna give someone else a good time and it costs us easentially nothing, its self documenting code if you write it correctly! Admitadly PATCHing can require some additional boilerplate but Its also quite useful to have around during testing tbh
-
irene33915yOur clients don’t like using query parameters and have other crazy rules. So we tend to do a lot of things as post requests with the instructions in the body.
-
I use patch for the 'watch time' endpoint. The client requests a patch to it every minute, and after verification that it has actually been a minute since the last request, it increments the amount of watch minutes my user has in the database to keep track of how much they use the service. Not actually updating any data, just more of a ping, so the patch was appropriate.
-
Root797795yI use all of them. They're an extension of typical CRUD.
Get: get data
Post: create data
Patch: update data
Put: upload data (files)
Delete: delete data -
@Root why would i use patch,put,delete when i have post.. i wonder why.
show me some queries or page results. -
I even use OPTIONS. Helps to describe the requirements for the other method calls
-
irene33915yFor those wondering, DELETE doesn't have to hard delete a record in the database. You are the one building the system right?
Related Rants
Do you guys use PUT,DELETE,UPDATE http requests? I use like GET and POST. Keep me updated veterans!
question
getandpost
wonder
httprequests