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.
@@ -133,14 +133,23 @@ If you're using ES5 require statement to load the module, please add `default`.
133
133
var RNFetchBlob = require('react-native-fetch-blob').default
134
134
```
135
135
136
-
#### Regular Request
136
+
### HTTP Data Transfer
137
+
138
+
---
137
139
138
-
After `0.8.0` react-native-fetch-blob automatically decide how to send the body by checking `Content-Type` in header.
140
+
#### Regular Request
139
141
140
-
The rules are shown in the following diagram
142
+
After `0.8.0` react-native-fetch-blob automatically decide how to send the body by checking its type and `Content-Type` in header. The rule is described in the following diagram
- 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`.
144
153
145
154
#### Download example : Fetch files that needs authorization token
146
155
@@ -483,6 +492,8 @@ RNFetchBlob.config({
483
492
.then(...)
484
493
```
485
494
495
+
### File System
496
+
486
497
#### File Access
487
498
488
499
File access APIs were made when developing `v0.5.0`, which helping us write tests, and was not planned to be a part of this module. However we realized that, it's hard to find a great solution to manage cached files, every one who use this moudle may need these APIs for there cases.
@@ -631,7 +642,7 @@ RNFetchBlob.config({
631
642
})
632
643
```
633
644
634
-
####Web API Polyfills
645
+
### Web API Polyfills
635
646
636
647
After `0.8.0` we've made some [Web API polyfills](https://github.com/wkh237/react-native-fetch-blob/wiki/Web-API-Polyfills-(work-in-progress)) that makes some browser-based library available in RN.
0 commit comments