class Patron::Session

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

Returns:
  • (Patron::Response) -

Parameters:
  • headers (Hash) -- the hash of header keys to values
  • data (Hash, #to_s, #to_path) -- a Hash of form fields/values,
  • url (String) -- the URL to fetch
def post(url, data, headers = {})
  if data.is_a?(Hash)
    data = data.map {|k,v| urlencode(k.to_s) + '=' + urlencode(v.to_s) }.join('&')
    headers['Content-Type'] = 'application/x-www-form-urlencoded'
  end
  request(:post, url, headers, :data => data)
end