4 ms·
I was not aware you shouldn’t do that — what’s the rationale/historical context?
by dkdcio 9mo ago
I was not aware you shouldn’t do that — what’s the rationale/historical context?
- embedding-shape 9mo agoLike most standards: "Because it's a standard". Kind of like setting a .body for a GET request, you can kind of do that, but why not do it the way it's intended to instead? Use POST :)
- gunalx 9mo agoI have seen post being used instead of get, because of having encrypted parameters by default.
- embedding-shape 9mo agoYeah, and also because of firewalls sometimes stripping body of GET requests (not responses mind you, we're talking requests) to a server, and also because it's really uncommon to put a body on a GET request ;)
- deleted 9mo ago[deleted]
- ljm 9mo agoSending a URL encoded form or some JSON in a POST request is also easier for most people to understand than the myriad ways you might format a query string in the URL (which may have a stricter limit on size). You only have to look at how different services handle arrays in query strings to understand that serialising it is conceptually easier. Comes up a lot in search or filter APIs. I'm sure there was some effort many moons ago to create a QUERY method for that.