Skip to content

Instantly share code, notes, and snippets.

@weltonrodrigo
Created October 8, 2012 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weltonrodrigo/3855636 to your computer and use it in GitHub Desktop.
Save weltonrodrigo/3855636 to your computer and use it in GitHub Desktop.
use Mojo::UserAgent;
use v5.10;
my $ua = new Mojo::UserAgent;
my $tx = $ua->build_tx(GET => 'www.google.com.br');
say $tx->req->to_string;
$tx->req->headers->referrer('http://www.bing.com');
say $tx->req->to_string;;
__END__
GET / HTTP/1.1
Content-Length: 0
Host: www.google.com.br
GET / HTTP/1.1
Content-Length: 0
Host: www.google.com.br
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment