Hi all,
I'm working in Eclipse 3.5 using the most recent Google plugin 3.5.
I am attempting to use HTTPRequestPoster to send post data from an app
(with the server running on http://localhost:8888/) to a Tomcat server
running on port 8080 the same machine (MacBook pro). I can
successfully send info as a Get (and get a response) with the
following code:
String urlString = "http://localhost:8080/tester/TestService";
String getParams = "id=mmsend&grp=Dummy&msg=dummy
message";
HTTPRequestPoster rp = new HTTPRequestPoster();
String responseToGet = rp.sendGetRequest(urlString,
getParams);
System.out.println("Response-toGet="+ responseToGet);
However, where callingRequest is a fully instantiated Bean with String
fields and one ArrayList<String>, the following code doesn't work
because it doesn't insert any Post data in the request:
StringWriter sw = new StringWriter();
try {
HTTPRequestPoster.postObject(callingRequest, urlString, sw);
} catch (Exception e) {
e.printStackTrace();
}
String ResponseToPost = sw.toString();
In the doPost method on the receiving Tomcat, the following code shows
0 bytes:
InputStream inStream = request.getInputStream();
int nbytes = inStream.available();
System.out.println("# bytes available = "+nbytes);
What is the problem here?
Thanks in advance,
Ken Bowen
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.