# File lib/couchrest/core/rest_api.rb, line 28 def post(uri, doc = nil) payload = doc.to_json if doc begin JSON.parse(HttpAbstraction.post(uri, payload)) rescue Exception => e if $DEBUG raise "Error while sending a POST request #{uri}\npayload: #{payload.inspect}\n#{e}" else raise e end end end