Class Patron::Session
In: lib/patron/session.rb
ext/patron/session_ext.c
Parent: Object

Extension initialization

Methods

Attributes

auth_type  [RW]  Set the authentication type for the request. @see Patron::Request#auth_type
base_url  [RW]  Prepended to the URL in all requests.
buffer_size  [RW]  Set the buffer size for this request. This option will only be set if buffer_size is non-nil
connect_timeout  [RW]  HTTP connection timeout in seconds. Defaults to 1 second.
default_response_charset  [RW]  Default encoding of responses. Used if no charset is provided by the host.
headers  [R]  Standard set of headers that are used in all requests.
ignore_content_length  [RW]  Does this session ignore Content-Size headers?
insecure  [RW]  Does this session stricly verify SSL certificates?
max_redirects  [RW]  Maximum number of times to follow redirects. Set to 0 to disable and -1 to follow all redirects. Defaults to 5.
password  [RW]  Username and password for http authentication
proxy  [RW]  Proxy URL in cURL format (‘hostname:8080’)
proxy_type  [RW]  Proxy type (default is HTTP), see constants under ProxyType for supported types.
timeout  [RW]  HTTP transaction timeout in seconds. Defaults to 5 seconds.
username  [RW]  Username and password for http authentication

Public Class methods

Create a new Session object.

Public Instance methods

Sends a WebDAV COPY request to the specified url.

As get but sends an HTTP DELETE request.

Turn on cookie handling for this session, storing them in memory by default or in file if specified. The file must be readable and writable. Calling multiple times will add more files.

Enable debug output to stderr or to specified file.

URL escapes the provided string.

Retrieve the contents of the specified url optionally sending the specified headers. If the base_url varaible is set then it is prepended to the url parameter. Any custom headers are merged with the contents of the headers instance variable. The results are returned in a Response object. Notice: this method doesn‘t accept any data argument: if you need to send data with a get request, please, use the request method.

Retrieve the contents of the specified url as with get, but the content at the URL is downloaded directly into the specified file.

Turn on cookie handling for this session, storing them in memory by default or in file if specified. The file must be readable and writable. Calling multiple times will add more files.

Peform the actual HTTP request by calling libcurl. Each filed in the request object will be used to set the appropriate option on the libcurl library. After the request completes, a Response object will be created and returned.

In the event of an error in the libcurl library, a Ruby exception will be created and raised. The exception will return the libcurl error code and error message.

As get but sends an HTTP HEAD request.

Interrupt any currently executing request. This will cause the current request to error and raise an exception.

Uploads the passed data to the specified url using HTTP POST. data can be a string or a hash.

Uploads the contents of a file to the specified url using HTTP POST.

Uploads the contents of a file and data to the specified url using HTTP POST.

Uploads the passed data to the specified url using HTTP PUT. data must be a string.

Uploads the contents of a file to the specified url using HTTP PUT.

Send an HTTP request to the specified url.

Reset the underlying cURL session. This effectively closes all open connections and disables debug output.

Enable debug output to stderr or to specified file.

urldecode(p1)

Alias for unescape

urlencode(p1)

Alias for escape

[Validate]