Using EntityUtils in Android causes the thread to crash
<p>I'm currently trying to send a post to a php script, which seems to work fine. However, when I try and extract the string from the HttpEntity it causes the thread to crash. I'm really not sure what I'm doing wrong.</p>

<pre><code>HttpClient client = new DefaultHttpClient();
String postURL = "&lt;hidden/not relevant&gt;";
HttpPost categoryPost = new HttpPost(postURL);
List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
params.add(new BasicNameValuePair("userID", userID));
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params, HTTP.UTF_8);
categoryPost.setEntity(ent);
responsePOST = client.execute(categoryPost);
HttpEntity resEntity = responsePOST.getEntity();

if (resEntity != null) {
    // TODO Fix this line!!!
    //categoryTest = EntityUtils.toString(resEntity);

    // TODO Then uncomment this line.
    //playedCategories = categoryTest.split(",");

    // This strangely works, but the first use(above) of EntityUtils does not.
    Log.i("RESPONSE", EntityUtils.toString(resEntity));
}
</code></pre>

<p>The Log prints the correct string from resEntity out to LogCat, but the line  above it is causing the crash.</p>

<p>Following Errors:<br>
when <br>
<code>categoryTest = EntityUtils.toString(resEntity);</code> <br>
is uncommented I get the following error on the VD screen: "process * has stopped unexpectedly" and the following error in LogCat:<br></p>

<pre><code>03-13 23:48:13.194: ERROR/AndroidRuntime(220): Uncaught handler: thread Thread-8 exiting due to uncaught exception
03-13 23:48:13.194: ERROR/AndroidRuntime(220): java.lang.IllegalStateException: Content has been consumed
03-13 23:48:13.194: ERROR/AndroidRuntime(220):     at org.apache.http.entity.BasicHttpEntity.getContent(BasicHttpEntity.java:84)
03-13 23:48:13.194: ERROR/AndroidRuntime(220):     at org.apache.http.conn.BasicManagedEntity.getContent(BasicManagedEntity.java:100)
03-13 23:48:13.194: ERROR/AndroidRuntime(220):     at org.apache.http.util.EntityUtils.toString(EntityUtils.java:112)
03-13 23:48:13.194: ERROR/AndroidRuntime(220):     at org.apache.http.util.EntityUtils.toString(EntityUtils.java:146)
03-13 23:48:13.194: ERROR/AndroidRuntime(220):     at android.triviarea.data.User.requestAvailableCategories(User.java:112)
03-13 23:48:13.194: ERROR/AndroidRuntime(220):     at android.triviarea.main.MainScreen$1$1.run(MainScreen.java:63)
</code></pre>
