3 ms·
POSTing a body, when a GET param is more RESTy, is unfortunate. But I am curious if some amount of developer convenience is leading to REST-like APIs (I like th
by jagged-chisel 5y ago
POSTing a body, when a GET param is more RESTy, is unfortunate. But I am curious if some amount of developer convenience is leading to REST-like APIs (I like the way you put it) going out of style.
A curiosity to be sure, and by no means a critical problem.
EDIT: added some commas to help with parsing since I have my phrasing all turned about.
- SahAssar 5y agoQuery-params are not "un-RESTy", and posting when requesting static data is worse primarily for caching and semantics. For this usecase a ?chapter=1 query string would have been better and not at all less "RESTy".
- jagged-chisel 5y agoI think you're read my message in reverse. I've said that POSTing is unRESTful when a GET is preferred.
- SahAssar 5y agoAh, yeah, seems I misunderstood!
- 1_player 5y agoIt's not even a case of being RESTy or not. A GET request with a `?chapter=1` argument is more correct than POST because then it's cacheable by browsers, proxies or middleware clients, and thus respects the spirit of the HTTP protocol. Only if the Qur'an is immutable, that is.
- trutannus 5y agoWait until you come across an API that uses POST requests as GET requests. Worked on one recently where all search operations were submitted by POSTing the data. And it wasn't even something like a "send a search request to a queue".