Skip to content

Commit fb8db51

Browse files
committed
fix(android): support for application/x-www-form-urlencoded
1 parent d1119a9 commit fb8db51

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/https.android.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ export function createRequest(opts: Https.HttpsRequestOptions): Https.HttpsReque
433433
}
434434
});
435435
okHttpBody = builder.build();
436+
} else if (type === 'application/x-www-form-urlencoded') {
437+
const builder = new okhttp3.FormBody.Builder();
438+
Object.keys(opts.body).forEach((key) => {
439+
builder.add(key, opts.body[key]);
440+
});
441+
okHttpBody = builder.build();
436442
} else {
437443
let body;
438444
if (opts.body) {

0 commit comments

Comments
 (0)