Class: ActiveResource::Connection

Class | ActiveResource::Connection
In: | lib/active_resource/connection.rb lib/active_resource/http_mock.rb
Parent: | Object

Class to handle connections to remote web services. This class is used by ActiveResource::Base to interface with REST services.

### Methods

delete get head new password= post put requests site= timeout= user=

### Constants

HTTP_FORMAT_HEADER_NAMES | = | { :get => 'Accept', :put => 'Content-Type', :post => 'Content-Type', :delete => 'Accept'

### Attributes

format | [RW] |
password | [R] |
site | [R] |
timeout | [R] |
user | [R] |

### Public Class methods

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()

### Public Instance methods

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.

[Validate]