Class | Patron::Session |
In: |
lib/patron/session.rb
|
Parent: | Object |
This class represents multiple request/response transactions with an HTTP server. This is the primary API for Patron.
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. |
headers | [R] | Standard set of headers that are used in all requests. |
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 |
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.
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.