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

GET vs POST for search #62

Closed
abdollar opened this issue Apr 30, 2014 · 3 comments
Closed

GET vs POST for search #62

abdollar opened this issue Apr 30, 2014 · 3 comments
Labels

Comments

@abdollar
Copy link

I noticed the trace returns curl compatible output. As in:-

curl -X GET 'http://localhost:9200/blah/_search?pretty' -d ' ...

For curl, it looks like by default using the -d argument switches to a POST request by default -- the `-X GET' is necessary to keep it as a GET request, but the HTTP spec sorta implies that the body of a GET request is meaningless.

Here's a thread where someone else is wondering whether a GET having a body makes any sense - see http://stackoverflow.com/questions/978061/http-get-with-request-body

Is there a de-facto standard which treats parameters in the body as URL parameters except that they don't need to be fully url escaped?

elasticsearch supports a POST request - shouldn't that be the default or at least configurable since that conforms to standards.

@karmi karmi added the feature label Apr 30, 2014
@karmi
Copy link
Contributor

karmi commented Apr 30, 2014

Hi, so, I don't really wanna get into the "is GET with body RESTful or not" discussion :) I can see arguments on both sides of the debate. For what it's worth, Roy Fielding seems to be against he idea of body in a GET request.

On the Ruby side, yeah, totally agreed that it should be configurable. I would like to implement something like the Python client did in elastic/elasticsearch-py@cf03f98 soon.

@kcdragon
Copy link

kcdragon commented Sep 6, 2014

Added PR #93 for this issue.

@karmi karmi closed this as completed in abc1d4d Sep 8, 2014
@asbjornu
Copy link

Related: elastic/elasticsearch#16024.

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

No branches or pull requests

4 participants