Open ianneub opened 9 years ago
+1 for this issue. I use cocoa-rest-client to query elasticsearch and passing a get request body is important for that.
Eggplant eggplant eggplant eggplant eggplant Those eggplants represent the amount of swearing I did while trying to debug while my webserver was ignoring the GET body, before I checked the issue tracker and found out that this app doesn't send the body with a GET request.
Yeah... sorry about this. I will loosen this restriction in the next release. If there's one thing I've learned over the years of working on this project it's that people/frameworks throw anything they want into the HTTP method and that anything goes when it comes to usage of methods.
Playing around with this a bit and it may not even be possible with the NSMutableURLRequest
class that is built into Cocoa. Initiating a GET request with a body just results in the connection getting closed ... even if I run this against basically an open port (netcat). I'm wondering if there is something in the Objective-C API library that breaks when trying to do this.
It would be nice if the request body was sent along with a GET request. My use case is some finicky API that only accepts GET requests, but uses the body to parse a query.
While this is bad form, it doesn't seem violate the HTTP spec to send a body with a GET request.