Re: [webmin-devel] ajax with webmin
Krause Felix <[email protected]> Wed, 24 Jul 2013 06:09:14 +0000
| Newsgroups | gmane.comp.web.webmin.devel |
|---|---|
| Message-ID | <01E5320FA68E4D4E94C059320E4D29460DD9C658@svcstexbal05.devoteam.com> |
> Something like that should work - but you should remove the line that prints
> "HTTP/1.1 200 OK". This isn't necessary in any Webmin CGI script, as the
> webserver adds that line. The "500 Bad Header" error happens if your script's
> output doesn't start with valid HTTP headers.
I changed it to:
my $CRFL = "\x0d\x0a";
my $client = HTTP::Client->new();
my $content = $client->get("http://127.0.0.1:8888/io");
print "Date: " + time2str(localtime) + $CRLF;
print "Content-Type: text/json; Charset=iso-8859-1$CRLF";
print "Content-Length: " + length($content);
print "$CRLF$CRLF$content";
I get the same 500 error. Afaik these are the only required headers for a http response. Do I need to add others to make it work? Is there a log where Webmin tells me what it doesn't like about my headers? (The action log is empty.)
I would look what a normal index.cgi outputs, but I cannot execute it directly from the command line (it says that WEBMIN_CONFIG is not set).
Regards,
Felix
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel