Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add request body for GET request? needed for elasticsearch restful-api call? #380

Closed
hackrole opened this issue Sep 15, 2015 · 2 comments

Comments

@hackrole
Copy link

the elasticsearch api may add request body for get. like this.

curl -XGET 'http://localhost:9200/_count?pretty' -d '
{
    "query": {
        "match_all": {}
    }
}
'

but the httpie seems not allow such usage.

@jkbrzt
Copy link
Member

jkbrzt commented Sep 15, 2015

HTTPie makes it possible to specify request body for any HTTP method, including GET. In your case, passing it via STDIN is probably the best way to go:

$ echo '{"query": {"match_all": {}}}' | http GET :9200/_count?pretty

@hackrole
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants