in reply to using HTTP::Response directly
Hi
Can the HTTP::Response object be used directly in a server cgi script and if so, how should I use it to get it to work as expected...
A couple of ways
* it might work to simply configure/tell apache to treat cgi programs as "NPH", simple as naming the program with "nph-" like "nph-yada.cgi"
* Skip as_string, but copy what as_string does and edit it to remove the parts that dont comply with CGI protocol
* use CGI module for interacting with CGI not HTTP module
Hello monks I would expect the direct use of HTTP::Response object in a cgi script to deliver the correct output
Why?
Common Gateway Interface is different from HTTP
The CGI.pm module exists to take care of interacting with the webserver(apache) using CGI
It appears to me that the HTTP:Response object, when using method '->as_string', does not send (at least) the correct formatted status line.
The purpose of as_string is diagnostics, it provides a textual representation. HTTP is not as simple as print $req->as_string;, but you're not dealing with plain HTTP, you're dealing with CGI
HTTP::Request::AsCGI, HTTP::Response::CGI
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using HTTP::Response directly to speak CGI
by Habs (Acolyte) on Jan 09, 2017 at 08:16 UTC | |
by Anonymous Monk on Jan 09, 2017 at 11:09 UTC |