Greg Morehead
|
Re: Ajax issue, problems with the responseXML from an XMLHttpRequest
|
Greg Morehead
01/23/2009 9:38 AM
post20695
|
Re: Ajax issue, problems with the responseXML from an XMLHttpRequest
My gut says I am still not getting the header to transfer correctly?
In the documentation for slinger it states:
When Slinger executes a CGI script, it parses the output of the script for HTTP header directives. Slinger must buffer
the header directives, before transmitting the script data, in case a header directive is passed that'll affect the
format of the default header directives. Up to 1K of header information can be buffered. CGI scripts must provide a
valid header.
Slinger identifies the end of the header as a blank line, lines are terminated with a <LF> or a <CR><LF>. A common HTTP
header directive to provide specifies the type of data that the CGI script provides. The default Content-Type is "text/
html." For example:
Content-Type: text/html<LF>
<LF>
CGI script data...
However, it does not seem to be capturing any of my stream as a header? For example, I tried changing the status return
to 201, but it does not have any effect on the actual status which the XMLHttpRequest object gets.
When I look at the page source for the return I see:
HTTP/1.1 Status: 201 OK Server: custom-cgi Connection: close
Content-Type: text/xml<LF><LF>
<?xml version="1.0"?><quad-1>
<Q1-State>Charge</Q1-State>
<Q1-SubState>Charging</Q1-SubState>
</quad-1>
My XMLHttpRequest object is requesting the page xml_data.shtml from slinger. The contents of xml_data.shtml is simply:
<!--#config cmdecho="ON" -->
<!--#exec cmd="/usr/web/cgi/TFWeb 1" -->
The cmd line output from "TFWeb 1" is:
HTTP/1.1 Status: 201 OK Server: custom-cgi Connection: close
Content-Type: text/xml<LF>
<LF>
<?xml version="1.0"?>
<quad-1>
<Q1-State>Charge</Q1-State>
<Q1-SubState>Charging</Q1-SubState>
</quad-1>
I also tried moving the header data into the shtml file instead of as output from the executable with no affect.
Any ideas? And again thanks.
|
|
|