|
|
|
|
47
|
// When request body is a Blob, use file URI of the Blob as request body.
|
47
|
// When request body is a Blob, use file URI of the Blob as request body.
|
48
|
else if (body.isRNFetchBlobPolyfill)
|
48
|
else if (body.isRNFetchBlobPolyfill)
|
49
|
promise = Promise.resolve(RNFetchBlob.wrap(body.blobPath))
|
49
|
promise = Promise.resolve(RNFetchBlob.wrap(body.blobPath))
|
50
|
- else if (typeof body !== 'object')
|
|
|
|
|
50
|
+ else if (typeof body !== 'object' && options.headers['Content-Type'] !== 'application/json')
|
51
|
promise = Promise.resolve(JSON.stringify(body))
|
51
|
promise = Promise.resolve(JSON.stringify(body))
|
52
|
else if (typeof body !== 'string')
|
52
|
else if (typeof body !== 'string')
|
53
|
promise = Promise.resolve(body.toString())
|
53
|
promise = Promise.resolve(body.toString())
|