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

Commit a6417c3

Browse files
authored
Update README.md
1 parent bd8e25e commit a6417c3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ After `0.8.0` react-native-fetch-blob automatically decide how to send the body
145145

146146
To sum up :
147147

148-
- If you're going to send a form data, the `Content-Type` header won't take effect if the body is an `Array` because we will set proper content type for you.
149-
- If you're going to send binary data, you have two choices, use BASE64 encoded string or a file path which points to a file contains the body. The `Content-Type` header does not matters.
150-
- If the body is a BASE64 encoded string, the `Content-Type` header filed must containing substring`;BASE64` or `application/octet`
151-
- If the body is a path point to a file, it must be a string starts with `RNFetchBlob-file://`, which can simply done by `RNFetchBlob.wrap(PATH_TO_THE_FILE)`
152-
- If you're going to send the body as-is, set a `Content-Type` header not containing `;BASE64` or `application/octet`.
148+
- To send a form data, the `Content-Type` header won't take effect if the body is an `Array` because we will set proper content type for you.
149+
- To send binary data, you have two choices, use BASE64 encoded string or a file path which points to a file contains the body. The `Content-Type` header does not matters.
150+
- The body is a BASE64 encoded string, the `Content-Type` header filed must containing substring`;BASE64` or `application/octet`
151+
- The body is a path point to a file, it must be a string starts with `RNFetchBlob-file://`, which can simply done by `RNFetchBlob.wrap(PATH_TO_THE_FILE)`
152+
- To send the body as-is, set a `Content-Type` header not containing `;BASE64` or `application/octet`.
153153

154154
#### Download example : Fetch files that needs authorization token
155155

@@ -649,6 +649,14 @@ After `0.8.0` we've made some [Web API polyfills](https://github.com/wkh237/reac
649649
- Blob
650650
- XMLHttpRequest (Use our implementation if you're going to use it with Blob)
651651

652+
### Performance Tips
653+
654+
React Native connects JS and Native context by passing JSON through RCT bridge, therefore there will an overhead to convert data before they sent. When data is large, this will be quite a performance impact to your app. When upload and download large data it's better to use file storage instead of BASE64 encoding. The following chart show how much faster when loading a data from storage than BASE64 encoded string on iphone 6.
655+
656+
<img src="img/performance_1.png" style="width : 100%"/>
657+
658+
TODO
659+
652660

653661
## Changes
654662

0 commit comments

Comments
 (0)