Skip to content

Commit

Permalink
fix(android): support for application/x-www-form-urlencoded
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Jul 1, 2021
1 parent d1119a9 commit fb8db51
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/https.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,12 @@ export function createRequest(opts: Https.HttpsRequestOptions): Https.HttpsReque
}
});
okHttpBody = builder.build();
} else if (type === 'application/x-www-form-urlencoded') {
const builder = new okhttp3.FormBody.Builder();
Object.keys(opts.body).forEach((key) => {
builder.add(key, opts.body[key]);
});
okHttpBody = builder.build();
} else {
let body;
if (opts.body) {
Expand Down

0 comments on commit fb8db51

Please sign in to comment.