in reply to Curl and Quoting JSON Data
I think the main problem was that the subroutine in ::FromCurl is named ->_build_body when it should have been named ->_build_quoted_body. That in turn would make the programming error on my part obvious because the HTTP::Request object was built as:
sub as_request( $self ) { HTTP::Request->new( $self->method => $self->uri, [ %{ $self->headers } ], $self->_build_quoted_body(), # was $self->_build_body ) };
... which is obviously wrong. ->_build_quoted_body should only be used when creating Perl code as output.
The fix, on its way to CPAN in version 0.11, is to use the plain ->body:
sub as_request( $self ) { HTTP::Request->new( $self->method => $self->uri, [ %{ $self->headers } ], $self->body(), ) };
|
|---|