You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -145,11 +145,11 @@ After `0.8.0` react-native-fetch-blob automatically decide how to send the body
145
145
146
146
To sum up :
147
147
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`.
153
153
154
154
#### Download example : Fetch files that needs authorization token
155
155
@@ -649,6 +649,14 @@ After `0.8.0` we've made some [Web API polyfills](https://github.com/wkh237/reac
649
649
- Blob
650
650
- XMLHttpRequest (Use our implementation if you're going to use it with Blob)
651
651
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.
0 commit comments