fixed a typo added when I added more debugging info to the request processing
This commit is contained in:
parent
b1999ac8b7
commit
d383c5a7d4
|
@ -125,10 +125,11 @@ module CouchRest
|
||||||
end
|
end
|
||||||
|
|
||||||
def put(uri, doc = nil)
|
def put(uri, doc = nil)
|
||||||
|
payload = doc.to_json if doc
|
||||||
begin
|
begin
|
||||||
JSON.parse(RestClient.post(uri, payload))
|
JSON.parse(RestClient.put(uri, payload))
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
raise "Error while sending a POST request #{uri}\npayload: #{payload.inspect}\n#{e}"
|
raise "Error while sending a PUT request #{uri}\npayload: #{payload.inspect}\n#{e}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -142,7 +143,11 @@ module CouchRest
|
||||||
|
|
||||||
def post uri, doc = nil
|
def post uri, doc = nil
|
||||||
payload = doc.to_json if doc
|
payload = doc.to_json if doc
|
||||||
|
begin
|
||||||
JSON.parse(RestClient.post(uri, payload))
|
JSON.parse(RestClient.post(uri, payload))
|
||||||
|
rescue Exception => e
|
||||||
|
raise "Error while sending a POST request #{uri}\npayload: #{payload.inspect}\n#{e}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete uri
|
def delete uri
|
||||||
|
|
Loading…
Reference in a new issue