diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-01 12:30:52 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-01 12:30:52 +0000 |
commit | ab70e53ac3b5102d4ecbe8f38d4f76afad29d37d (patch) | |
tree | 6c68653e33e9f6a1c8e74d96669e058952bd60e9 /test/net/http/utils.rb | |
parent | b64083376ef9fdd04ea48d7b4002934ab4f921b9 (diff) | |
download | ruby-ab70e53ac3b5102d4ecbe8f38d4f76afad29d37d.tar.gz |
* lib/net/http.rb: adding support to rfc5789 patch verb.
Added a Net::HTTP::Patch class which expects a message body
and response body. It recycles the post method into a patch one,
that will send the encoded representation to the server.
Summarizing, a new class has been created, the post method
extracted into send_entity, including a new argument,
which defines which class to use (Post or Patch) and
finally a patch method was created. [ruby-core:30426]
Patched by Guilherme Silveira
<guilherme.silveira AT caelum.com.br>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/http/utils.rb')
-rw-r--r-- | test/net/http/utils.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index 10c88d70d7..32cea2a78c 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -92,6 +92,12 @@ module TestNetHTTPUtils res.body = req.body res.chunked = @chunked end + + def do_PATCH(req, res) + res['Content-Type'] = req['Content-Type'] + res.body = req.body + res.chunked = @chunked + end end class NullWriter |