lib/url/handlers/ty_handler.rb in url-0.2.2 vs lib/url/handlers/ty_handler.rb in url-0.3.0
- old
+ new
@@ -16,19 +16,30 @@
def delete(args={})
resp = Typhoeus::Request.delete(url.to_s)
make_str(resp)
end
+
+ def put(args={})
+ resp = Typhoeus::Request.put(url.to_s, :body => url.params.to_s(false))
+ make_str(resp)
+ end
+
+ def head(args={})
+ resp = Typhoesu::Request.head(url.to_s)
+ make_str(resp)
+ end
private
def make_str(resp)
hsh = {
:code => resp.code,
:time => resp.time,
:body => resp.body,
:response => resp,
- :url => url.to_s
+ :url => url.to_s,
+ :url_obj => url
}
Response.new(hsh)
end
\ No newline at end of file