From b0da041ba998ee8b07dda61a362348cfbad6a421 Mon Sep 17 00:00:00 2001 From: Jorrin <43169049+JorrinKievit@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:11:11 +0100 Subject: [PATCH] set header for urlsearchparams request --- src/fetchers/body.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fetchers/body.ts b/src/fetchers/body.ts index 2d9d219..c859a2a 100644 --- a/src/fetchers/body.ts +++ b/src/fetchers/body.ts @@ -12,7 +12,9 @@ export function serializeBody(body: FetcherOptions['body']): SeralizedBody { if (body === undefined || typeof body === 'string' || body instanceof URLSearchParams || body instanceof FormData) { if (body instanceof URLSearchParams && isReactNative()) { return { - headers: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, body: body.toString(), }; }