5 ms·
If we need GET requests with bodies, why not simply add a body to GET?
by JanLikar 5y ago
If we need GET requests with bodies, why not simply add a body to GET?
- dragonwriter 5y agoBecause then you don't know if something that supports GET supports the new broader definition or the old definition, whereas if does or does not support QUERY is more clear. Also because a different method means OPTIONS tells you information about what is supported, while overloading GET would not. And because “same guarantees” doesn't mean “means the same thing”; PUT and DELETE have the same guarantees (idempotent but not safe), but we don't use PUT with no body for DELETE.
- mrcarruthers 5y agoI'm fairly certain that (technically) nothing's stopping you from doing so. However, there are so many libraries/clients/etc... that do not allow it that it would be almost impossible to patch them all. Adding a new method and having libraries add it and support it properly would be better.
- throw_m239339 5y agocause HTTP agents are allowed to ignore the body of a get request, per spec.