Skip to content

Instantly share code, notes, and snippets.

@azisaka
Created October 25, 2008 17:42
Show Gist options
  • Save azisaka/19756 to your computer and use it in GitHub Desktop.
Save azisaka/19756 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'uri'
require 'net/http'
require 'net/https'
require 'hpricot'
uri = URI::parse("https://pagseguro.uol.com.br/Default.aspx")
http = Net::HTTP.new(uri.host, 443)
http.use_ssl = true
form_data = { 'UcLogin1$Email' => 'bruno@dookie.com.br',
'UcLogin1$txtSenha' => '',
'__VIEWSTATE' => '/wEPDwUJNzUzNzk0ODY1ZGRZut/ApSvnCpFqV4B1apxlo1+4GQ==',
'__EVENTVALIDATION' => '/wEWBALgz9yPDAKMzOOSBgK18LirBgKQiaXeDUqQuH0w+ItP6BClfPJj0tH79CpX' }.map { |k,v| "#{k}=#{v}"}.join("&")
resp = http.request_post(uri.path, form_data)
puts resp.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment