L
Lee Francis Wilhelmsen
Hi
Not sure this is totally on topic, but I imagine someone here can answer
this. (Is there a better group?)
I'm trying to post some XML data to a web server using a HTTPS connection.
I'm using java to do this.
Does this look right as a valid HTTP request to send? It seems the server
can't understand the xml part.
POST /servlet HTTP/1.1
Host: serverhostname
Authorization: Basic JSK4RL5JW3ER
<?xml version="1.0"?>
<request>
<requestcontents/>
</request>
Must I add a Content-Length header? I have tried that as well, but I'm not
100% sure I calcualted the correct content length. I used
int length = new String("xml content as string").getBytes().length;
Must the XML be URL encoded? If so, do you then have to calculate the length
of the encoded xml instead of the original xml?
Forgive my ignorance.
regards
Lee Francis
Not sure this is totally on topic, but I imagine someone here can answer
this. (Is there a better group?)
I'm trying to post some XML data to a web server using a HTTPS connection.
I'm using java to do this.
Does this look right as a valid HTTP request to send? It seems the server
can't understand the xml part.
POST /servlet HTTP/1.1
Host: serverhostname
Authorization: Basic JSK4RL5JW3ER
<?xml version="1.0"?>
<request>
<requestcontents/>
</request>
Must I add a Content-Length header? I have tried that as well, but I'm not
100% sure I calcualted the correct content length. I used
int length = new String("xml content as string").getBytes().length;
Must the XML be URL encoded? If so, do you then have to calculate the length
of the encoded xml instead of the original xml?
Forgive my ignorance.
regards
Lee Francis