started extracting the http layer
This commit is contained in:
parent
bd1b114930
commit
b2a29d9eb7
8 changed files with 158 additions and 81 deletions
35
lib/couchrest/core/adapters/restclient.rb
Normal file
35
lib/couchrest/core/adapters/restclient.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
module RestClientAdapter
|
||||
|
||||
module API
|
||||
def proxy=(url)
|
||||
RestClient.proxy = url
|
||||
end
|
||||
|
||||
def proxy
|
||||
RestClient.proxy
|
||||
end
|
||||
|
||||
def get(uri, headers={})
|
||||
RestClient.get(uri, headers)
|
||||
end
|
||||
|
||||
def post(uri, payload, headers={})
|
||||
RestClient.post(uri, payload, headers)
|
||||
end
|
||||
|
||||
def put(uri, payload, headers={})
|
||||
RestClient.put(uri, payload, headers)
|
||||
end
|
||||
|
||||
def delete(uri, headers={})
|
||||
RestClient.delete(uri, headers)
|
||||
end
|
||||
|
||||
def copy(uri, headers)
|
||||
RestClient::Request.execute( :method => :copy,
|
||||
:url => uri,
|
||||
:headers => headers)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue