D
Danny Woods
Hi all,
I have a script that listens on a socket, reads some XML from an
external entity, slaps a POST header on it, and POSTs it off to a Web
server for processing. So, using HTTP::Request::Common, it's a simple
matter of:
$request = POST("http://www.no-server-here.com/cgi-bin/script.cgi");
$request->header("Content-Length", length($xml));
$request->content($xml);
When sent, this looks something like:
POST http://www.no-server-here.com/cgi-bin/script.cgi
Content-Length: [some-number]
<some-xml..../>
But I have a client who (for some reason) wants:
POST /cgi-bin/script.cgi HTTP/1.0
Host: www.no-server-here.com
Content-Length: [some-number]
<some-xml..../>
?
The RFC states (at
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5) that
requests start with a request line, which has a format of:
Method SP Request-URI SP HTTP-Version CRLF
The format for a Request-URI seems to be leaning towards the absolute
format produced by HTTP::Request, but the other format with the Host
header is still valid. In any case, the protocol and version don't
appear to be optional, and yet are missed out by HTTP::Request.
Is there any way that I'm missing to hammer the request string into
shape, or so I have to resort to sockets and hand made requests?
Many thanks,
Danny.
I have a script that listens on a socket, reads some XML from an
external entity, slaps a POST header on it, and POSTs it off to a Web
server for processing. So, using HTTP::Request::Common, it's a simple
matter of:
$request = POST("http://www.no-server-here.com/cgi-bin/script.cgi");
$request->header("Content-Length", length($xml));
$request->content($xml);
When sent, this looks something like:
POST http://www.no-server-here.com/cgi-bin/script.cgi
Content-Length: [some-number]
<some-xml..../>
But I have a client who (for some reason) wants:
POST /cgi-bin/script.cgi HTTP/1.0
Host: www.no-server-here.com
Content-Length: [some-number]
<some-xml..../>
?
The RFC states (at
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5) that
requests start with a request line, which has a format of:
Method SP Request-URI SP HTTP-Version CRLF
The format for a Request-URI seems to be leaning towards the absolute
format produced by HTTP::Request, but the other format with the Host
header is still valid. In any case, the protocol and version don't
appear to be optional, and yet are missed out by HTTP::Request.
Is there any way that I'm missing to hammer the request string into
shape, or so I have to resort to sockets and hand made requests?
Many thanks,
Danny.