in reply to Re: "Unexpected end of stream while looking for line"
in thread "Unexpected end of stream while looking for line"

Can you provide your suspected code? (give only the essential)

If I knew what was essential to be provided, I'd have done it in the first place. Here's some of my code:

#!/usr/bin/perl use strict; use warnings; use HTTP::Tiny; use JSON; use Test::JSON; use utf8::all; use URI::Escape; use Smart::Comments '###'; use List::Util qw(min max); use Statistics::Basic qw(median mode); # ... my $http = HTTP::Tiny->new(timeout => 6000); # ... $response = $http->post($url, {headers=>{Authorization=>"token $access_token +"}, content=>$query}); die $! unless is_valid_json $response->{content}; # ...

Replies are listed 'Best First'.
Re^3: "Unexpected end of stream while looking for line"
by GotToBTru (Prior) on Jan 08, 2016 at 13:22 UTC

    Essential means enough to demonstrate the problem. Sometimes the exercise of producing this reveals the source of the problem.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

      As I said, this occurs only for a specific HTTP POST request, and not for others. Therefore, sufficient information to demonstrate the problem would mean including the POST request. I cannot do that, as it includes my employer's proprietary information. However, I can assure you that the HTTP requests that results in this error and those that don't are extremely similar, and the expected responses are, too.
        As I said, this occurs only for a specific HTTP POST request, and not for others. Therefore, sufficient information to demonstrate the problem would mean including the POST request. I cannot do that, as it includes my employer's proprietary information. However, I can assure you that the HTTP requests that results in this error and those that don't are extremely similar, and the expected responses are, too.

        Start by minimally modifying the problematic HTTP request. If you have no better idea, start by omitting one of the query parameters, try for every query parameter. Or change the query parameter values. Again, change only one thing.

        To get more help, try to replace the propritary information with dummy values and post code that still shows the problem.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)