From e6a9c179c4f171e30a49cfff352bed60c0e70206 Mon Sep 17 00:00:00 2001 From: Mike Monteith Date: Wed, 19 Oct 2016 12:29:15 +0100 Subject: [PATCH] Don't stringify body if Content-Type is application/json --- src/polyfill/Fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyfill/Fetch.js b/src/polyfill/Fetch.js index 77ec06cd3..8015b313b 100644 --- a/src/polyfill/Fetch.js +++ b/src/polyfill/Fetch.js @@ -47,7 +47,7 @@ class RNFetchBlobFetchPolyfill { // When request body is a Blob, use file URI of the Blob as request body. else if (body.isRNFetchBlobPolyfill) promise = Promise.resolve(RNFetchBlob.wrap(body.blobPath)) - else if (typeof body !== 'object') + else if (typeof body !== 'object' && options.headers['Content-Type'] !== 'application/json') promise = Promise.resolve(JSON.stringify(body)) else if (typeof body !== 'string') promise = Promise.resolve(body.toString())