Skip to content

Commit

Permalink
fix(android): get application/x-www-form-urlencoded as string (#6165)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jan 11, 2023
1 parent 6816b98 commit 0735e89
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@ public void setRequestBody(PluginCall call, JSValue body) throws JSONException,
dataString = call.getString("data");
}
this.writeRequestBody(dataString != null ? dataString : "");
} else if (contentType.contains("application/x-www-form-urlencoded")) {
StringBuilder builder = new StringBuilder();

JSObject obj = body.toJSObject();
Iterator<String> keys = obj.keys();
while (keys.hasNext()) {
String key = keys.next();
Object d = obj.get(key);
builder.append(key).append("=").append(URLEncoder.encode(d.toString(), "UTF-8"));

if (keys.hasNext()) {
builder.append("&");
}
}
this.writeRequestBody(builder.toString());
} else {
this.writeRequestBody(body.toString());
}
Expand Down

0 comments on commit 0735e89

Please sign in to comment.