8000 Ruby 1 9 1 by isaacsanders · Pull Request #119 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Ruby 1 9 1 #119

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/net/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class HTTPHeaderSyntaxError < StandardError; end
# Net::HTTP::Head
# Net::HTTP::Post
# Net::HTTP::Put
# Net::HTTP::Patch
# Net::HTTP::Proppatch
# Net::HTTP::Lock
# Net::HTTP::Unlock
Expand Down Expand Up @@ -918,6 +919,12 @@ def put(path, data, initheader = nil) #:nodoc:
res
end

def patch(path, data, initheader = nil) #:nodoc:
res = request(Patch.new(path, initheader), data)
res.value unless @newimpl
res
end

# Sends a PROPPATCH request to the +path+ and gets a response,
# as an HTTPResponse object.
def proppatch(path, body, initheader = nil)
Expand Down Expand Up @@ -1738,6 +1745,12 @@ class Put < HTTPRequest
RESPONSE_HAS_BODY = true
end

class Patch < HTTPRequest
METHOD = 'PATCH'
REQUEST_HAS_BODY = true
RESPONSE_HAS_BODY = true
end

class Delete < HTTPRequest
METHOD = 'DELETE'
REQUEST_HAS_BODY = false
Expand Down
0