java.lang.IllegalArgumentException: method GET must not have a request body.
See original GitHub issueWhat kind of issue is this?
-
Question. This issue tracker is not the place for questions. If you want to ask how to do something, or to understand why something isn’t working the way you expect it to, use Stack Overflow. https://stackoverflow.com/questions/tagged/okhttp
-
Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests get fixed. Here’s an example: https://gist.github.com/swankjesse/981fcae102f513eb13ed
-
Feature Request. Start by telling us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.
I’m trying to do a get request to Elasticsearch with a query body but OkHttp doesn’t allow that. The query works with curl:
curl -XGET 'localhost:9200/fncd/event/_search?scroll=1m' -d '
{
"query": {
"range" : {
"lastUpdated" : {
"gte": 1486184400000
}
}
}
}
'
Issue Analytics
- State:
- Created 7 years ago
- Reactions:15
- Comments:19 (6 by maintainers)
Top GitHub Comments
It’s unlikely we’ll ever support request bodies with GET.
No further action to take on this.
OkHttp is an opinionated HTTP client. By constraining what we support to what the specs allow, we’re able to keep things relatively simple and offer great features like smart caching.
Elasticsearch is wrong for exposing APIs that use GET requests with bodies. They should fix their API.