lib/shared/http.rb in yawast-0.6.0.beta2 vs lib/shared/http.rb in yawast-0.6.0.beta3
- old
+ new
@@ -45,9 +45,21 @@
end
body
end
+ def self.put(uri, body, headers = nil)
+ begin
+ req = get_http(uri)
+ req.use_ssl = uri.scheme == 'https'
+ res = req.request_put(uri.path, body, get_headers(headers))
+ rescue
+ #do nothing for now
+ end
+
+ res.read_body
+ end
+
def self.get_status_code(uri)
req = get_http(uri)
req.use_ssl = uri.scheme == 'https'
res = req.head(uri.path, get_headers)
res.code