Skip to content

Commit f63ca98

Browse files
committed
Added String response param, to ease the work with response
1 parent 53167b4 commit f63ca98

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

library/src/com/loopj/android/http/BaseJsonHttpResponseHandler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public BaseJsonHttpResponseHandler(String encoding) {
3838
super(encoding);
3939
}
4040

41-
public void onSuccess(int statusCode, Header[] headers, JSON_TYPE response) {
41+
public void onSuccess(int statusCode, Header[] headers, String rawResponse, JSON_TYPE response) {
4242
}
4343

44-
public void onFailure(int statusCode, Header[] headers, Throwable e, JSON_TYPE errorResponse) {
44+
public void onFailure(int statusCode, Header[] headers, Throwable e, String rawData, JSON_TYPE errorResponse) {
4545
}
4646

4747
@Override
@@ -55,22 +55,22 @@ public void run() {
5555
postRunnable(new Runnable() {
5656
@Override
5757
public void run() {
58-
onSuccess(statusCode, headers, jsonResponse);
58+
onSuccess(statusCode, headers, responseBody, jsonResponse);
5959
}
6060
});
6161
} catch (final Throwable t) {
6262
Log.d(LOG_TAG, "parseResponse thrown an problem", t);
6363
postRunnable(new Runnable() {
6464
@Override
6565
public void run() {
66-
onFailure(statusCode, headers, t, (JSON_TYPE) null);
66+
onFailure(statusCode, headers, t, responseBody, null);
6767
}
6868
});
6969
}
7070
}
7171
}).start();
7272
} else {
73-
onSuccess(statusCode, headers, (JSON_TYPE) null);
73+
onSuccess(statusCode, headers, null, null);
7474
}
7575
}
7676

@@ -85,22 +85,22 @@ public void run() {
8585
postRunnable(new Runnable() {
8686
@Override
8787
public void run() {
88-
onFailure(statusCode, headers, e, jsonResponse);
88+
onFailure(statusCode, headers, e, responseBody, jsonResponse);
8989
}
9090
});
9191
} catch (Throwable t) {
9292
Log.d(LOG_TAG, "parseResponse thrown an problem", t);
9393
postRunnable(new Runnable() {
9494
@Override
9595
public void run() {
96-
onFailure(statusCode, headers, e, (JSON_TYPE) null);
96+
onFailure(statusCode, headers, e, responseBody, null);
9797
}
9898
});
9999
}
100100
}
101101
}).start();
102102
} else {
103-
onFailure(statusCode, headers, e, (JSON_TYPE) null);
103+
onFailure(statusCode, headers, e, null, null);
104104
}
105105
}
106106

0 commit comments

Comments
 (0)