//This was working before I overhauled the authentication of my app
//I'm trying to store the body of a Http POST as Text, I also plan on
doing a Blob version
//The maxLength is returning the correct size, but the read is
returning -1 instead of properly
//updating the body byte array

//...

InputStream httpIn = req.getInputStream();
byte[] body = new byte[httpIn.available()];
httpIn.read(body);

Text myPostBody = new Text(new String(body)); //wasteful maybe? but
should work

//...

//My old code was roughly the same

//...

int maxLength = req.getContentLength();
byte[] body = new byte[maxLength];

InputStream httpIn = req.getInputStream();
httpIn.read(body, 0, maxLength);

String  myPostBody = new String(body); //wasteful maybe? but should
work

//...

--

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=.


Reply via email to