Why my HttpPost can't receive all response data?

Posted by Johnny on Stack Overflow See other posts from Stack Overflow or by Johnny
Published on 2010-05-08T02:18:38Z Indexed on 2010/05/08 9:48 UTC
Read the original article Hit count: 206

Filed under:
|
|
|

I'm on Android 1.5, and my code is like this:

HttpPost httpPost = new HttpPost(url);
HttpEntity entity = new UrlEncodedFormEntity(params, HTTP.UTF_8);
httpPost.setEntity(entity);

HttpResponse response = httpClient.execute(httpPost);
HttpEntity respEntity = response.getEntity();
String result = EntityUtils.toString(respEntity, DEFAULT_CHARSET);

After successfully executed these codes, the result is a stripped string. I've tried using browser to test the url+param, it works fine and got all data.

What's wrong with this code? Is there any parameters I need to specified?

© Stack Overflow or respective owner

Related posts about android

Related posts about java