Closed bbkr closed 11 years ago
I don't think HTTP::Easy will support the former. The PSGI specification, and indeed, from my reading of it, the HTTP specification, deems that a response must be sent for every request, even if the response is simply an HTTP status code with no content.
The psgi.input is a part of the PSGI specification, and will not change, however, querying the psgi.input to determine if it is a Str, Buf or IO object is recommended, as the exact nature of the object is not set in stone (and indeed will likely be changing in a future update to HTTP::Easy when I enable Buf.)
Thanks for answering my questions.
I switched to HTTP::Easy - https://github.com/bbkr/jsonrpc/blob/master/lib/JSON/RPC/Server.pm#L12-36
Buf and IO psgi.input
cases are also handled.
As for notifications and closing connection without sending any data back - I asked on JSON-RPC group what is the "most correct" behavior when transport layer must return something and I'm sure they ran into this issue many times on many frameworks so I'll implement their suggestion later when they respond.
Thanks again :)
I'm glad it worked out for you. On top of updates coming to HTTP::Easy, I'm planning to update HTTP::Client to fix some outstanding bugs. Then it may be a match for your JSON::RPC::Client library.
I'm trying to replace HTTP transport in my JSON::RPC module with HTTP::Easy, to do so I need to resolve two issues:
$app
method but it just crashes whole server witherror.
I found that in HTTP::Easy content is available in "psgi.input" env key. Is it something that I can rely on or it may change in the future into something like
POSTDATA
(like the one described in P5 CGI POD )?