11

Do you guys use PUT,DELETE,UPDATE http requests? I use like GET and POST. Keep me updated veterans!

Comments
  • 8
    I 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.
  • 4
    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
  • 3
    In 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.
  • 2
    The real question is who bothers to follow the idempotent rules
  • 2
    @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.
  • 3
    @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.
  • 4
    You now have OPTIONS to choose from ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚
  • 2
    I 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
  • 3
    I use
    Get = get
    Post = create
    Put = replace
    Patch = update
    Delete = delete
  • 1
    Our 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.
  • 0
    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.
  • 0
    For URL normalization?
  • 0
    I use all except PUT
  • 1
    I 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
  • 0
    @Root why would i use patch,put,delete when i have post.. i wonder why.

    show me some queries or page results.
  • 2
    @sandeepbalan
    > Why would I ever use delete to delete data? ๐Ÿค”๐Ÿคจ
  • 0
    I even use OPTIONS. Helps to describe the requirements for the other method calls
  • 0
    For those wondering, DELETE doesn't have to hard delete a record in the database. You are the one building the system right?
Add Comment