AnyEvent-HTTP-ScopedClient

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

go to https://github.com/aanoaa/AnyEvent-HTTP-ScopedClient/issues for the roadmap and known issues.

v0.0.5    Sun Jun 23 22:03:40 2013 KST
    - prevent 'newline' at 'Authorization' header

v0.0.4    Thu May 30 11:13:44 2013 KST
    - uri_escape_utf8(request_body)

0.0.3    Fri Nov 30 10:04:43 2012 KST
    - depend `Host` req header to `AnyEvent::HTTP`

0.0.2    Thu Oct 11 10:59:18 2012 KST
    - support editing multiple header at once
    - enhancement test
    - tidied all source code

lib/AnyEvent/HTTP/ScopedClient.pm  view on Meta::CPAN

    }

    my %options = %{ $self->options };
    try {
        my %headers = %{ $options{headers} };

        if ( 'HASH' eq ref($reqBody) ) {
            my @pair;

            # push @pair, "$_=$reqBody->{$_}" for ( keys %$reqBody );
            push @pair, "$_=" . uri_escape_utf8( $reqBody->{$_} )
                for ( keys %$reqBody );
            $reqBody = join( '&', @pair );
        }

        my $sendingData
            = ( $method =~ m/^P/ && $reqBody && length $reqBody > 0 ) ? 1 : 0;
        $headers{'Content-Length'} = length $reqBody if $sendingData;
        $headers{'Content-Type'} = 'application/x-www-form-urlencoded'
            if ( $sendingData && !$headers{'Content-Type'} );



( run in 0.252 second using v1.01-cache-2.11-cpan-c21f80fb71c )