Skip to content

Commit

Permalink
Add gitignore + style change
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Logan committed Jan 27, 2016
1 parent fb2304a commit d23f84a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.moarvm
*.swp
*.jar
blib/
tmp/
lib/.precomp/
.precomp/
14 changes: 8 additions & 6 deletions lib/Net/HTTP/POST.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ class Net::HTTP::POST {
proto method CALL-ME(|) {*}
multi method CALL-ME(Str $abs-url, :%header is copy, :$body?, |c --> Response) {
my $url = Net::HTTP::URL.new($abs-url);
my $req = Net::HTTP::Request.new: :$url, :$body, :method<POST>, :User-Agent<perl6-net-http>;
%header<Connection> = 'keep-alive',
$req.header = %header;


samewith($req, |c);
with Net::HTTP::Request.new(:$url, :$body, :method<POST>, :User-Agent<perl6-net-http>) -> $req {
temp %header<Connection> //= <keep-alive>;
temp %header<User-Agent> //= <perl6-net-http>;
$req.body = $body || Buf.new;
$req.header = %header;
samewith($req, |c);
}
}

multi method CALL-ME(Request $req, Response ::RESPONSE = Net::HTTP::Response --> Response) {
state $transport = Net::HTTP::Transport.new;
$transport.round-trip($req, RESPONSE) but ResponseBodyDecoder;
Expand Down

0 comments on commit d23f84a

Please sign in to comment.