Skip to content

Instantly share code, notes, and snippets.

@xaicron
Created June 11, 2011 08:06
Show Gist options
  • Save xaicron/1020357 to your computer and use it in GitHub Desktop.
Save xaicron/1020357 to your computer and use it in GitHub Desktop.
Furl::HTTP->new->request(
method => 'GET',
host => 'example.com',
port => 80,
path => '/',
);
# User-Agent: Furl::HTTP/0.32
Furl::HTTP->new(agent => 'gfx')->request(
method => 'GET',
host => 'example.com',
port => 80,
path => '/',
);
# User-Agent: gfx
Furl::HTTP->new(headers => ['User-Agent' => 'yappo'])->request(
method => 'GET',
host => 'example.com',
port => 80,
path => '/',
);
# User-Agent: Furl::HTTP/0.32
# User-Agent: yappo
Furl::HTTP->new(agent => 'Foo')->request(
method => 'GET',
host => 'example.com',
port => 80,
path => '/',
request => ['User-Agent' => 'Hoge'],
);
# USer-Agent: Foo
# User-Agent: Hoge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment