To bad, in this case you probably have to dig into Mojo::Transaction,
Mojo::Transaction::HTTP, Mojo::Message and Mojo::Message::Response to
check, why the content is not read/parsed (according to the spec for the
server, the content should be read until the disconnect is received, so
there is a chance that it is read, but I haven't checked to sources).

Hope this helps a little

+rl
--
Roland Lammel
QuikIT - IT Lösungen - flexibel und schnell
Web: http://www.quikit.at
Phone: +43 (676) 9737845
Email: [email protected]

"Enjoy your job, make lots of money, work within the law. Choose any two."


On Tue, Jun 3, 2014 at 10:10 AM, Ivan Korjavin <[email protected]> wrote:

> Thank you Roland.
>
> But I can't do anything with this server, its not mine, its third party
> integration.
>
> May be, I can switch mojo:ua for something less strict?
>
> I need advice.
>
> вторник, 3 июня 2014 г., 14:01:27 UTC+6 пользователь Roland Lammel написал:
>>
>> The server is definitly omitting the Content-Length header here, which
>> seems to case the UA to not consider the body. in HTTP/1.0 it seems there
>> is no clear indication on how a response should be handled without
>> Content-Length (on the request side HTTP/1.0 requires a content-length to
>> be set, as Mojo::UA does).
>>
>> RFC: http://www.w3.org/Protocols/HTTP/1.0/spec.html
>>
>> I would definitly try to correctly send a content-length for your hpd
>> server, to ensure it is parsed correctly on all clients.
>> Otherwise you verify the spec and if you find the Mojo::UA behaviour not
>> according to the spec, provide a spec test.
>>
>> I personally never had any issues with paring the response (but also
>> never had a server not supplying the content-length)
>>
>> +rl
>> --
>> Roland Lammel
>> QuikIT - IT Lösungen - flexibel und schnell
>> Web: http://www.quikit.at
>> Phone: +43 (676) 9737845
>> Email: [email protected]
>>
>>
>> "Enjoy your job, make lots of money, work within the law. Choose any two."
>>
>>
>> On Tue, Jun 3, 2014 at 9:27 AM, Ivan Korjavin <[email protected]> wrote:
>>
>>>  I add more debug with morbo and MOJO_USERAGENT_DEBUG=1
>>>
>>> there is log:
>>>
>>> ====
>>>
>>> -- Blocking request (http://myserver:11080/hydra?command=check&txn_id=9&;
>>> account=210220&sum=10.00)
>>> -- Connect (http:myserver:11080)
>>> -- Client >>> Server (http://myserver:11080/hydra?
>>> command=check&txn_id=9&account=210220&sum=10.00)
>>> GET /hydra?command=check&txn_id=9&account=210220&sum=10.00 HTTP/1.1
>>> User-Agent: Mojolicious (Perl)
>>> Connection: keep-alive
>>> Accept-Encoding: gzip
>>> Content-Length: 0
>>> Host: myserver:11080
>>>
>>>
>>> -- Client <<< Server (http://myserver:11080/hydra?
>>> command=check&txn_id=9&account=210220&sum=10.00)
>>> HTTP/1.0 200 OK
>>>
>>> -- Client <<< Server (http://myserver:11080/hydra?
>>> command=check&txn_id=9&account=210220&sum=10.00)
>>> Server: hpd/1.0.9.2
>>> Date: Tue, 03 Jun 2014 07:23:00 GMT
>>>
>>> <?xml version="1.0" encoding="utf-8"?><response><
>>> txn_id>9</txn_id><result>5</result><comment>Неверные
>>> данные</comment></response>
>>>
>>> ===
>>>
>>> But
>>> $ua->get($uri)->res;
>>>
>>> is
>>>
>>> HTTP/1.0 200 OK
>>> Date: Tue, 03 Jun 2014 07:20:09 GMT
>>> Content-Length: 0
>>> Server: hpd/1.0.9.2
>>>
>>> without data.
>>>
>>>
>>>
>>>>  I have web service with strange server (Server: hpd/1.0.9.2), and it
>>>> always return me  Content-Length: 0 on my request.
>>>>
>>>> my $ua          = Mojo::UserAgent->new;
>>>>> my $res  = $ua->get($uri)->res;
>>>>>
>>>>
>>>> And $res always empty.
>>>>
>>>> But wget ignore this content-length and show me tight document.
>>>>
>>>> How to ignore this in Mojo:Ua ?
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>>
>>> Visit this group at http://groups.google.com/group/mojolicious.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to