Skip to content

Instantly share code, notes, and snippets.

@brianmed
Last active December 26, 2015 04:09
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 brianmed/7090642 to your computer and use it in GitHub Desktop.
Save brianmed/7090642 to your computer and use it in GitHub Desktop.
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
$ua->cert(...);
$ua->transactor->http_proxy(...);
$ua->max_redirects(3);
# Say hello to the Unicode snowman with "Do Not Track" header
say $ua->get('www.☃.net?hello=there' => {DNT => 1})->res->body;
__MAYBE__
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
$ua->cert(...);
$ua->proxy->http(...);
$ua->proxy->https(...);
$ua->proxy->without(...); # no
$ua->proxy->detect(...);
$ua->proxy->required(...); # need
$ua->max_redirects(3);
# Say hello to the Unicode snowman with "Do Not Track" header
say $ua->get('www.☃.net?hello=there' => {DNT => 1})->res->body;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment