Subject: | Possibly causes mangling of request |
schmorp on AnyEvent irc channel suggested i report this bug here. I'm
trying to POST with AnyEvent::HTTP::Request using an HTTP::Request
constructed from another module, but the request that gets sent on the
wire is mangled. I initially posted this question on perlmonks:
http://www.perlmonks.org/?node_id=1001399 .
I have attached a script to demonstrate the issue.
Subject: | ae-httpreq.pl |
#!/usr/bin/env perl
use 5.014;
use warnings;
use Data::Dump;
BEGIN {
package Local::Finance::MtGox;
use parent 'Finance::MtGox';
# Don't post to th real mtgox server, post to a site that displays the
# request.
sub _build_api_method_uri {
return URI->new("http://h.wrttn.me/post");
}
}
use AnyEvent;
use AnyEvent::HTTP::Request;
use AnyEvent::HTTP::Response;
my $mtgox = Local::Finance::MtGox->new({ key => 'key', secret => 'secret' });
my $cv = AE::cv;
my $req = AnyEvent::HTTP::Request->new(
# Returns an HTTP::Request
$mtgox->_build_api_method_request(POST => 'getFunds'),
{
cb => sub {
my $res = AnyEvent::HTTP::Response->new(@_)->to_http_message;
dd $res;
$cv->send;
},
params => {
tls_ctx => 'low',
# Debugging with Charles proxy.
# proxy => ['127.0.0.1', 8888],
},
}
);
$req->send;
$cv->wait;