Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Don't stringify body if Content-Type is application/json #161

Merged
merged 1 commit into from
Oct 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/polyfill/Fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down