Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sets the delete body if specified.

  • Loading branch information...
commit 8e0b9b6cc7d177868499cd9f57e21284dbf2501c 1 parent 014b3ee
@treeder treeder authored
View
4 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- rest (2.0.4)
+ rest (2.1.0)
net-http-persistent
rest-client (>= 0.3.0)
@@ -12,7 +12,7 @@ GEM
ffi (1.1.5)
mime-types (1.19)
minitest (3.5.0)
- net-http-persistent (2.7)
+ net-http-persistent (2.8)
quicky (0.1.1)
rake (0.9.2.2)
rest-client (1.6.7)
View
1  lib/rest/wrappers/net_http_persistent_wrapper.rb
@@ -169,6 +169,7 @@ def delete(url, req_hash={})
uri = URI(url)
post = Net::HTTP::Delete.new fix_path(uri.request_uri)
add_headers(post, req_hash, default_headers)
+ post.body = stringed_body(req_hash[:body]) if req_hash[:body]
response = http.request uri, post
r = NetHttpPersistentResponseWrapper.new(response)
case response
View
4 test/test_rest.rb
@@ -156,7 +156,11 @@ def test_post_with_headers
:headers => headers)
p response
+ end
+ def test_form_post
+ r = @rest.post("http://google.com/search", :params=>{q: "Rick Astley"})
+ p r
end
def test_gzip
View
6 test/tmp.rb
@@ -9,5 +9,11 @@ def setup
end
+
+ def test_form_post
+ r = @rest.post("http://google.com/search", :params=>{q: "Rick Astley"})
+ p r
+ end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.