summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index ed68c81a1a..de89f090f7 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -799,6 +799,12 @@ module Net # :nodoc:
request(Mkcol.new(path, initheader), body)
end
+ # Sends a TRACE request to the +path+ and gets a response,
+ # as an HTTPResponse object.
+ def trace(path, initheader = nil)
+ request(Trace.new(path, initheader))
+ end
+
# Sends a GET request to the +path+ and gets a response,
# as an HTTPResponse object.
#
@@ -1503,6 +1509,12 @@ e @header.each_key(&block)
REQUEST_HAS_BODY = true
RESPONSE_HAS_BODY = true
end
+
+ class Trace < HTTPRequest
+ METHOD = 'TRACE'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+ end
end