supernovus / perl6-http-client

Build HTTP Clients easily with Perl 6
18 stars 11 forks source link

Content inaccessible #4

Open Te1ken opened 10 years ago

Te1ken commented 10 years ago

Any attempt to access the contents of an HTTP Response results in a crash, with an exception being thrown.

Exception:

Nominal type check failed for parameter '$str'; expected Str but got Array instead in sub unbase at gen/parrot/CORE.setting:6833 in block at lib/HTTP/Client/Response.pm6:113 in method dechunk at lib/HTTP/Client/Response.pm6:106 in method contents at lib/HTTP/Client/Response.pm6:140 in method content at lib/HTTP/Client/Response.pm6:146 in block at test.p6:7

Full source being used to test: 1 use v6; 2 use HTTP::Client; 3 4 my $client = HTTP::Client.new; 5 my $response = $client.get('http://www.whatismyip.com/'); 6 if $response.success { 7 say $response.content; 8 }

avalenn commented 6 years ago

As explained on https://github.com/supernovus/perl6-http-client/issues/5#issuecomment-376493303 the dechunk method (on third line of the stack trace) is buggy.