Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # CODE 1 :
- my ($response) = $http->do_request(
- uri => URI->new($url)
- )->get;
- # CODE 2 :
- my $pngbufleft = $pngsize;
- my $response = $http->POST(
- URI->new($url),
- sub {
- return(undef) unless( $pngbufleft > 0 && !eof(PNG) );
- my $buf;
- if( $pngbufleft > 32767 ){
- sysread(PNG, $buf, 32768);
- }else{
- sysread(PNG, $buf, $pngbufleft);
- }
- $pngbufleft -= length($buf);
- return($buf);
- },
- {
- content_type => "image/png",
- content_length => $pngsize
- }
- )->get;
- # ERROR:
- # Odd number of elements in hash assignment at /usr/local/share/perl5/Net/Async/HTTP.pm line 834.
- # Not an ARRAY reference at /usr/local/share/perl5/HTTP/Request/Common.pm line 89.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement