Skip to content

Commit e1f0ed1

Browse files
committed
remove getresponsebody
1 parent 5872e97 commit e1f0ed1

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/com/loopj/android/http/AsyncHttpResponseHandler.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ public void sendResponseMessage(HttpResponse response) {
5858
sendFailureMessage(new HttpResponseException(status.getStatusCode(), status.getReasonPhrase()));
5959
} else {
6060
try {
61-
sendSuccessMessage(getResponseBody(response));
61+
HttpEntity entity = null;
62+
HttpEntity temp = response.getEntity();
63+
if(temp != null) {
64+
entity = new BufferedHttpEntity(temp);
65+
}
66+
67+
sendSuccessMessage(EntityUtils.toString(entity));
6268
} catch(IOException e) {
6369
sendFailureMessage(e);
6470
}
@@ -130,16 +136,6 @@ protected Message obtainMessage(int responseMessage, Object response) {
130136
return msg;
131137
}
132138

133-
protected String getResponseBody(HttpResponse response) throws IOException {
134-
HttpEntity entity = null;
135-
HttpEntity temp = response.getEntity();
136-
if(temp != null) {
137-
entity = new BufferedHttpEntity(temp);
138-
}
139-
140-
return EntityUtils.toString(entity);
141-
}
142-
143139

144140
// Public callbacks
145141
public void onStart() {}

0 commit comments

Comments
 (0)