Module | CouchRest::RestAPI |
In: |
lib/couchrest/rest_api.rb
|
The basic low-level interface for all REST requests to the database. Everything must pass through here before it is sent to the server.
Five types of REST requests are supported: get, put, post, delete, and copy.
Requests that do not have a payload, get, delete and copy, accept the URI and options parameters, where as put and post both expect a document as the second parameter.
The API will try to intelegently split the options between the JSON parser and RestClient API.
The following options will be recognised as header options and automatically added to the header hash:
The following request options are supported:
Any other remaining options will be sent to the MultiJSON backend except for the :raw option.
When :raw is true in PUT and POST requests, no attempt will be made to convert the document payload to JSON. This is not normally necessary as IO and Tempfile objects will not be parsed anyway. The result of the request will always be parsed.
For all other requests, mainly GET, the :raw option will make no attempt to parse the result. This is useful for receiving files from the database.