Skip to content

Commit a133e53

Browse files
committed
fix(https): android application/x-www-form-urlencoded fix
1 parent 99e54a9 commit a133e53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/https/request.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ export function createRequest(opts: HttpsRequestOptions, useLegacy: boolean = tr
547547
} else if (type === 'application/x-www-form-urlencoded') {
548548
const builder = new okhttp3.FormBody.Builder();
549549
Object.keys(opts.body).forEach((key) => {
550-
builder.add(key, opts.body[key]);
550+
if (opts.body[key] !== undefined && opts.body[key] !== null) {
551+
builder.add(key, opts.body[key]);
552+
}
551553
});
552554
okHttpBody = builder.build();
553555
} else {

0 commit comments

Comments
 (0)