class Patron::Session

server. This is the primary API for Patron.
This class represents multiple request/response transactions with an HTTP

def delete(url, headers = {})

def delete(url, headers = {})
  do_request(:delete, url, headers)
end

def do_request(action, url, headers, data = nil)

Creates a new Request object from the parameters and instance variables.
def do_request(action, url, headers, data = nil)
  req = Request.new
  req.action = action
  req.timeout = self.timeout
  req.connect_timeout = self.connect_timeout
  req.max_redirects = self.max_redirects
  req.headers = self.headers.merge(headers)
  req.username = self.username
  req.password = self.password
  req.upload_data = data
  req.url = self.base_url.to_s + url.to_s
  raise ArgumentError, "Empty URL" if req.url.empty?
  handle_request(req)
end

def get(url, headers = {})

Response object.
of the +headers+ instance variable. The results are returned in a
to the +url+ parameter. Any custom headers are merged with the contents
specified headers. If the +base_url+ varaible is set then it is prepended
Retrieve the contents of the specified +url+ optionally sending the
def get(url, headers = {})
  do_request(:get, url, headers)
end

def head(url, headers = {})

As #get but sends an HTTP HEAD request.
def head(url, headers = {})
  do_request(:head, url, headers)
end

def initialize

Create an instance of the Session class.
def initialize
  ext_initialize
  @headers = {}
  @timeout = 5
  @connect_timeout = 1000
  @max_redirects = -1
end

def post(url, data, headers = {})

def post(url, data, headers = {})
  do_request(:post, url, headers, data)
end

def put(url, data, headers = {})

def put(url, data, headers = {})
  do_request(:put, url, headers, data)
end