-
Notifications
You must be signed in to change notification settings - Fork 73
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
Conversation
Does this new code get exercised by the test suite? I don't see any test code in the patch. |
oh... you should look at the last file (spec/session_spec.rb) in the patch https://github.com/ddnexus/patron/commit/436a2ce8bdce987cd6bb2d4029a62ea04b4d3a45 |
Ah, whoops, I missed that. Sorry. Will merge now. |
Added support for sending data with delete requests
thanks! |
👍 Any chance of a point release? |
I don't have creds to release, @toland would have to. |
@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 = {}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Unusual, but needed by elasticsearch for the delete by query API.
(see http://www.elasticsearch.org/guide/reference/api/delete-by-query/)