- Inheritance
- < Object
Class to handle connections to remote web services. This class is used by ActiveResource::Base to interface with REST services.
Constants
| Name | Description | |
|---|---|---|
| HTTP_FORMAT_HEADER_NAMES | = { :get => 'Accept', :put => 'Content-Type', :post => 'Content-Type', :delete => 'Accept' |
Attributes
| Name | Visibility | R/W | Description |
|---|---|---|---|
| format | public | RW | |
| password | public | R | |
| site | public | R | |
| timeout | public | R | |
| user | public | R |
Methods
Class
| Visibility | Signature |
|---|---|
| public | new (site, format = ActiveResource::Formats[:xml]) |
| public | requests () |
Instance
| Visibility | Signature |
|---|---|
| public | delete (path, headers = {}) |
| public | get (path, headers = {}) |
| public | head (path, headers = {}) |
| public | password= (password) |
| public | post (path, body = '', headers = {}) |
| public | put (path, body = '', headers = {}) |
| public | site= (site) |
| public | timeout= (timeout) |
| public | user= (user) |
Class Method Detail
new(site, format = ActiveResource::Formats[:xml])
The site parameter is required and will set the site attribute to the URI for the remote resource service.
requests()
Instance Method Detail
delete(path, headers = {})
Execute a DELETE request (see HTTP protocol documentation if unfamiliar). Used to delete resources.
get(path, headers = {})
Execute a GET request. Used to get (find) resources.
head(path, headers = {})
Execute a HEAD request. Used to obtain meta-information about resources, such as whether they exist and their size (via response headers).
password=(password)
Set password for remote service.
post(path, body = '', headers = {})
Execute a POST request. Used to create new resources.
put(path, body = '', headers = {})
Execute a PUT request (see HTTP protocol documentation if unfamiliar). Used to update resources.
site=(site)
Set URI for remote service.
timeout=(timeout)
Set the number of seconds after which HTTP requests to the remote service should time out.
user=(user)
Set user for remote service.