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

Added support for sending data with delete requests #71

Merged
merged 1 commit into from Aug 23, 2013
Merged

Added support for sending data with delete requests #71

merged 1 commit into from Aug 23, 2013

Conversation

ddnexus
Copy link
Contributor

@ddnexus ddnexus commented Jul 8, 2013

Unusual, but needed by elasticsearch for the delete by query API.

(see http://www.elasticsearch.org/guide/reference/api/delete-by-query/)

@terabyte
Copy link
Collaborator

Does this new code get exercised by the test suite? I don't see any test code in the patch.

@ddnexus
Copy link
Contributor Author

ddnexus commented Aug 2, 2013

oh... you should look at the last file (spec/session_spec.rb) in the patch https://github.com/ddnexus/patron/commit/436a2ce8bdce987cd6bb2d4029a62ea04b4d3a45

@terabyte
Copy link
Collaborator

Ah, whoops, I missed that. Sorry. Will merge now.

terabyte added a commit that referenced this pull request Aug 23, 2013
Added support for sending data with delete requests
@terabyte terabyte merged commit 6c62eb9 into toland:master Aug 23, 2013
@ddnexus
Copy link
Contributor Author

ddnexus commented Aug 23, 2013

thanks!

@ryansch
Copy link

ryansch commented Sep 5, 2013

👍 Any chance of a point release?

@terabyte
Copy link
Collaborator

I don't have creds to release, @toland would have to.

@karmi
Copy link

karmi commented Jul 28, 2014

@toland Hi, any chance revisiting this? Elasticsearch uses DELETE requests with bodies.

UPDATE: Sorry, I overlooked it was merged. Is it part of a release?

@@ -141,6 +141,8 @@ def head(url, headers = {})
end

# As #get but sends an HTTP DELETE request.
# Notice: this method doesn't accept any +data+ argument: if you need to send data with
# a delete request, please, use the #request method.
def delete(url, headers = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddnexus So, we need to somehow specially wrap @session.request(:delete, "/test", {}, :data => data) in Elasticsearch client, or? Why not allow data here, in the method arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason is that I wanted to provide a minimum patch that works and be as less invasive as possible, trying also to respect the same policy used in other methods in the same library (e.g. #get). So if we have a broader request method that now supports also delete with data, we can use that one without making any other API change.

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

Successfully merging this pull request may close these issues.

None yet

4 participants