mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-07-26 00:00:14 +08:00
When responseType is set to json, the data should be returned as plain json string, not as a base64 encoded string.
This commit is contained in:
@@ -193,7 +193,7 @@ abstract class CordovaHttpBase implements Runnable {
|
||||
response.setHeaders(request.headers());
|
||||
|
||||
if (request.code() >= 200 && request.code() < 300) {
|
||||
if ("text".equals(this.responseType)) {
|
||||
if ("text".equals(this.responseType) || "json".equals(this.responseType)) {
|
||||
String decoded = HttpBodyDecoder.decodeBody(outputStream.toByteArray(), request.charset());
|
||||
response.setBody(decoded);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user