4 ms·
> I can safely assume [...] CRUD actions are mapped to POST/GET/PUT/DELETE Not totally sure about that - I think you need to check what they decided about PUT
by OJFord 1y ago
> I can safely assume [...] CRUD actions are mapped to POST/GET/PUT/DELETE
Not totally sure about that - I think you need to check what they decided about PUT vs PATCH.
- Xenoamorphous 1y agoIsn't that fairly straightforward? PUT for full updates and PATCH for partial ones. Does anybody do anything different?
- blueflow 1y agoPUT for partial updates, yes, constantly. What i worked with last week: https://docs.gitlab.com/api/projects/#edit-a-project https://docs.gitlab.com/api/projects/#edit-a-project
- CSMastermind 1y agoLots of people make PUTs that work like PATCHes and it drives me crazy. Same with people who use POST to retrieve information.
- akvadrako 1y agoWell you can't reliably use GET with bodies. There is the proposed SEARCH but using custom methods also might not work everywhere.
- Deukhoofd 1y agoThe SEARCH verb draft was superseded by the QUERY verb draft last I checked. QUERY is somewhat more adopted, though it's still very new.
- bmn__ 1y agoNo, QUERY. https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-safe-method-w-body#section-2 https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-saf... SEARCH is from RFC 5323 (WebDAV).
- andoando 1y agoThese verbs dont even make sense most of the time.
- OJFord 1y agoPOST /gql "Get thing" ... 200 "Permission denied to get thing" Hate it.
- wpm 1y agoYou sweet summer child.
- OJFord 1y agoThat's straightforwardly 'correct' and Fielding's thesis, yes. Yes people do things differently!
- Supermancho 1y agoIt's always better to use GET/POST exclusively. The verb mapping was theoretical from someone who didn't have to implement. I've long ago caved to the reality of the web's limited support for most of the other verbs.
- ardit33 1y agoAgreed... in most large (non trivial systems) REST ends up looking/devolving closer to RPC more and more and you end up just using get and post for most things and end up with a REST-ISH-RPC system in practice. REST purists will not be happy, but that's reality.
- paulddraper 1y agoWhat is the limited support for CONNECT/HEAD/OPTIONS/PUT/DELETE ?
- brigandish 1y agoIt was limited up until the last 10 years, and if someone hasn't updated their knowledge then it's still limited, I suppose.
- paulddraper 1y agoXMLHttpRequest? fetch? We're talking JSON APIs -- HTML forms are incompatible with that no matter the verb.
- brigandish 1y agoFetch came in around 2015, and XMLHttpRequest wasn't consistent in the way different verbs were handled, like redirects, as this blog post[0] from 2006 points out: > Basic redirect support is pretty universal, but things quickly fall apart on most browsers when you do tricky things like use non-GET/POST methods on redirecting resources. There were other things too, I'm not sure CORS supported anything but GET and POST early on either. Wanting consistency and then sticking to it isn't an inherently bad thing, there's a lot to know, and people don't update knowledge about everything (I'm speaking generally as well as including my self here). [0] https://www.mnot.net/blog/2006/01/23/test_xmlhttprequest https://www.mnot.net/blog/2006/01/23/test_xmlhttprequest