class Patron::Session

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