29

Kinda dumb that HTML forms don't support all of the HTTP methods (Only GET and POST!)

Comments
  • 2
    Yep.
  • 2
    It can be at times, double handling data can be a pain if you need to send over a put.
  • 0
    What are all of the http request forms? I only know get and post.
  • 0
    The only reason for it not being supported is browsers.
  • 7
    @hoch10 that should be all HTTP verbs as far as I am concerned:

    GET
    POST
    PUT
    PATCH
    DELETE
    HEAD
    CONNECT
    OPTIONS
    TRACE
  • 0
    Wait, what purpose do CONNECT, OPTIONS and TRACE serve?
  • 1
    @SZenC OPTIONS gives the available HTTP methods, the other ones I forgot...
  • 3
    @SZenC

    trace is used for debugging, usually turned off on prod servers and outputs any inputs.

    As for Connect, I think this is clearer then I'm going to be able explain it.

    https://developer.mozilla.org/en-US...
  • 0
    @kescherRant afaik it's actually the HTML standard not the browser implementation.
  • 0
    @C0D4 I’ve used connect in proxy chains before. I’m sure that link mentioned that, but clicking it would open a new tab in chrome and I already have so many that the count shows as a smiley face. Think it’s trying to tell me something, maybe I should open more tabs after all
  • 0
    Sad Put noises
  • 0
    @fuckwit PATCH is my favorite. If I see it ANYWHERE on API docs, I push out compagnie to drop this vendor immediately. Too much work on client side.
  • 1
    @NoToJavaScript how is PATCH too much work? If you use proper libraries, you shouldn't have to change one or two lines to move from POST or PUT to PATCH
  • 1
    @SZenC Workflow with APIs without already “ready” library. (If there is already a lib, I don’t care how it sends my data as long as it’s easy to use)

    Without patch :
    Get object
    Change a field
    Put the same object

    With patch :
    Get object
    Change a field
    Generate a dynamic object which contains only edited fields. Basically you are doing vendor’s job at validating changes
    Patch object.

    Why should I do their work ? It’s vendor’s job to detect changes. Ease of use will always trump performances (Well, up to certain point, but ig we are talking 50ms difference, I’m fine with simpler way). Ofcause, I agree that for performance and traffic PATCH is great.
  • 0
    @NoToJavaScript Most of the time, I'm already getting diff-objects from downstream, so building a PATCH is trivial. But if you get full objects from your downstream, I can understand how a PUT would better suit your needs.
Add Comment