|
@@ -1,4 +1,4 @@
|
1
|
|
-# react-native-fetch-blob [](https://badge.fury.io/js/react-native-fetch-blob)
|
|
1
|
+# react-native-fetch-blob [](https://badge.fury.io/js/react-native-fetch-blob) 
|
2
|
2
|
|
3
|
3
|
A react-native module for fetch file/image with custom headers, supports blob response data, and upload/download progress.
|
4
|
4
|
|
|
@@ -10,15 +10,6 @@ This module enables you upload/download binary data in js, see [Examples](#user-
|
10
|
10
|
|
11
|
11
|
The source code is very simple, just an implementation of native HTTP request, supports both Android (uses awesome native library [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client])) and IOS.
|
12
|
12
|
|
13
|
|
-## Major Changes
|
14
|
|
-
|
15
|
|
-| Version | |
|
16
|
|
-|---|---|
|
17
|
|
-| 0.3 | Upload/Download octet-stream and form-data |
|
18
|
|
-| 0.4 | Add base-64 encode/decode library and API |
|
19
|
|
-| 0.4.1 | Fixe upload form-data missing file extension problem on Android |
|
20
|
|
-| 0.4.2 | Supports upload/download progress |
|
21
|
|
-
|
22
|
13
|
## Usage
|
23
|
14
|
|
24
|
15
|
* [Installation](#user-content-installation)
|
|
@@ -161,7 +152,7 @@ Headers of HTTP request, value of headers should be `stringified`, if you're upl
|
161
|
152
|
Body of the HTTP request, body can either be a BASE64 string, or an array contains object elements, each element have 2 required property `name`, and `data`, and 1 optional property `filename`, once `filename` is set, content in `data` property will be consider as BASE64 string that will be converted into byte array later.
|
162
|
153
|
When body is a base64 string , this string will be converted into byte array in native code, and the request body will be sent as `application/octet-stream`.
|
163
|
154
|
|
164
|
|
-### `fetch(...).progress(eventListener):Promise<FetchBlobResponse>` added in `0.4.2`
|
|
155
|
+#### `fetch(...).progress(eventListener):Promise<FetchBlobResponse>` added in `0.4.2`
|
165
|
156
|
|
166
|
157
|
Register on progress event handler for a fetch request.
|
167
|
158
|
|
|
@@ -189,9 +180,24 @@ When `fetch` success, it resolve a `FetchBlobResponse` object as first argument.
|
189
|
180
|
#### text():string
|
190
|
181
|
returns decoded base64 string (done in js context)
|
191
|
182
|
|
|
183
|
+## Major Changes
|
|
184
|
+
|
|
185
|
+| Version | |
|
|
186
|
+|---|---|
|
|
187
|
+| 0.3 | Upload/Download octet-stream and form-data |
|
|
188
|
+| 0.4 | Add base-64 encode/decode library and API |
|
|
189
|
+| 0.4.1 | Fixe upload form-data missing file extension problem on Android |
|
|
190
|
+| 0.4.2 | Supports upload/download progress |
|
192
|
191
|
|
193
|
192
|
### Upcoming Features
|
194
|
193
|
|
|
194
|
+We are now working on v0.5.0, there will be some new features.
|
|
195
|
+
|
195
|
196
|
* Save file to storage directly
|
196
|
197
|
* Upload file from storage directly
|
197
|
198
|
* Custom MIME type in form data
|
|
199
|
+
|
|
200
|
+### Development
|
|
201
|
+
|
|
202
|
+If you're insterested in hacking this module, check our [development guide](https://github.com/wkh237/react-native-fetch-blob/wiki/Development-Guide), there might be something helpful.
|
|
203
|
+Please feel free to make a PR or file an issue.
|