2 ms·
Can't you send a body with a GET request? Why change the request to POST/something else if GET was a better semantic match?
by ancarda 7y ago
Can't you send a body with a GET request? Why change the request to POST/something else if GET was a better semantic match?
- lol768 7y agoYou can, but it's unusual. Probably best to implement the most obvious fix, particularly because a lot of libraries (and engineers) will associate data with the query string in the context of a GET request. Principle of least surprise and all that.
- buro9 7y agoIt should have been a POST. Idempotency and implications for which operations can be cached is why. GETs are cacheable, but if a PIN can change so can the answer. This is an authentication action, and it should have been POST.
- BillinghamJ 7y agoimo this is exactly the sort of situation where if you can't implement perfectly "clean" REST, you shouldn't try at all and just use a simplified RPC mechanism only instead. For my company, it's all POST-only, no URL params allowed, all inputs as JSON in the body only, no resource IDs in the path - just the method & version only.