4 ms·
I use POST for complex queries for this reason. Some things aren't easily URI encoded. Easier to just post JSON. Not pure REST, but I'm not really seeking purit
by sojournerc 7y ago
I use POST for complex queries for this reason. Some things aren't easily URI encoded. Easier to just post JSON. Not pure REST, but I'm not really seeking purity...
- rubber_duck 7y agoYea that's what everyone does but it seems like a pretty big oversight in REST
- dragonwriter 7y agoIt's not an oversight in REST, it's one of the ways of trying to faithfully implement REST over HTTP, which has a gaping hole in the standard set of methods that messes with that use case. While HTTP (specifically 1.1) is an implementation of REST principles, that use case wasn't front-and-center at the time (PATCH is also a recent fix to another hole.) There have been proposed standardized fixes such as generalizing the HTTP SEARCH method that first appeared in WebDAV[0], but none have yet gone far. [0] https://tools.ietf.org/html/draft-snell-search-method-01 https://tools.ietf.org/html/draft-snell-search-method-01
- 19870213 7y agoI suppose you could POST the query object and receive a 201 Created with Location header and then retrieve the results via GET?