Hi. I'm sure I'm doing something wrong, but don't know what...
I have an applet that communicates with a J2EE server. It's going OK with
java.net classes but I am wanting to see if I can make the thing more
robust with the HttpClient package.
We send up a stream of data, which the server reads, assembles into
meaningful data for it, and acts upon it. Usually it returns another
similarly formatted stream of data in return.
Here's what I'm doing:
HttpClient httpClient = new HttpClient();
PostMethod method = new PostMethod(completeURL);
method.setRequestHeader("Content-type", "text/xml; charset=UTF-8");
method.addParameter( "toServer", requestData.getText() );
int statusCode = -1;
try
{
statusCode = httpClient.executeMethod( method );
}
catch (HttpRecoverableException e)
.
.
.
However when I get to the server, request.getParameter("toServer") is null,
so the data isn't getting sent up. What's wrong with what I've done? I've
seen a few posts that say "use setRequestBody()" but that seems like a
cop-out. I have a parameter, I've set it, why isn't it being sent?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]