Skip to content

Instantly share code, notes, and snippets.

/-

Created March 3, 2015 21:10
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 anonymous/b8d93ed7b9ea7614c29d to your computer and use it in GitHub Desktop.
Save anonymous/b8d93ed7b9ea7614c29d to your computer and use it in GitHub Desktop.
diff --git a/lib/ojo.pm b/lib/ojo.pm
index b827bc7..9eb031b 100644
--- a/lib/ojo.pm
+++ b/lib/ojo.pm
@@ -121,6 +121,10 @@ resulting L<Mojo::Message::Response> object.
my $res = g('example.com');
my $res = g('http://example.com' => {Accept => '*/*'} => 'Hi!');
+ my $res = g(
+ 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
+ my $res = g(
+ 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});
Perform C<GET> request with L<Mojo::UserAgent/"get"> and return resulting
L<Mojo::Message::Response> object.
@@ -131,6 +135,10 @@ L<Mojo::Message::Response> object.
my $res = h('example.com');
my $res = h('http://example.com' => {Accept => '*/*'} => 'Hi!');
+ my $res = h(
+ 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
+ my $res = h(
+ 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});
Perform C<HEAD> request with L<Mojo::UserAgent/"head"> and return resulting
L<Mojo::Message::Response> object.
@@ -159,6 +167,10 @@ iterations, which defaults to C<1>.
my $res = o('example.com');
my $res = o('http://example.com' => {Accept => '*/*'} => 'Hi!');
+ my $res = o(
+ 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
+ my $res = o(
+ 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});
Perform C<OPTIONS> request with L<Mojo::UserAgent/"options"> and return
resulting L<Mojo::Message::Response> object.
@@ -167,6 +179,10 @@ resulting L<Mojo::Message::Response> object.
my $res = p('example.com');
my $res = p('http://example.com' => {Accept => '*/*'} => 'Hi!');
+ my $res = p(
+ 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
+ my $res = p(
+ 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});
Perform C<POST> request with L<Mojo::UserAgent/"post"> and return resulting
L<Mojo::Message::Response> object.
@@ -183,6 +199,10 @@ Dump a Perl data structure with L<Mojo::Util/"dumper">.
my $res = t('example.com');
my $res = t('http://example.com' => {Accept => '*/*'} => 'Hi!');
+ my $res = t(
+ 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
+ my $res = t(
+ 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});
Perform C<PATCH> request with L<Mojo::UserAgent/"patch"> and return resulting
L<Mojo::Message::Response> object.
@@ -191,6 +211,10 @@ L<Mojo::Message::Response> object.
my $res = u('example.com');
my $res = u('http://example.com' => {Accept => '*/*'} => 'Hi!');
+ my $res = u(
+ 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'});
+ my $res = u(
+ 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});
Perform C<PUT> request with L<Mojo::UserAgent/"put"> and return resulting
L<Mojo::Message::Response> object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment