couchrest_model/lib/couchrest/core/adapters/restclient.rb
Julien Kirch 38dad4bc78 added ascending compatability with restclient-1.4.0
Signed-off-by: Will Leinweber <will@bitfission.com>
2010-02-23 16:21:00 -06:00

35 lines
738 B
Ruby

module RestClientAdapter
module API
def proxy=(url)
RestClient.proxy = url
end
def proxy
RestClient.proxy
end
def get(uri, headers={})
RestClient.get(uri, headers).to_s
end
def post(uri, payload, headers={})
RestClient.post(uri, payload, headers).to_s
end
def put(uri, payload, headers={})
RestClient.put(uri, payload, headers).to_s
end
def delete(uri, headers={})
RestClient.delete(uri, headers).to_s
end
def copy(uri, headers)
RestClient::Request.execute( :method => :copy,
:url => uri,
:headers => headers).to_s
end
end
end