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
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ If you're dealing with image or file server that requires an `Authorization` tok
6
6
7
7
See [[fetch] Does fetch with blob() marshal data across the bridge?]([fetch] Does fetch with blob() marshal data across the bridge?).
8
8
9
-
This module enables you upload/download binary data in js, see [Examples](#user-content-usage) bellow.
9
+
This module enables you upload/download binary data in js, see [Examples](#user-content-usage) bellow.
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
@@ -131,6 +131,15 @@ Body of the HTTP request, body can either be a BASE64 string, or an array contai
131
131
132
132
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`.
133
133
134
+
#### `base64`
135
+
136
+
A helper object simply uses [base-64](https://github.com/mathiasbynens/base64) for decode and encode BASE64 data.
137
+
138
+
```js
139
+
RNFetchBlob.base64.encode(data)
140
+
RNFetchBlob.base64.decode(data)
141
+
```
142
+
134
143
### FetchBlobResponse
135
144
136
145
When `fetch` success, it resolve a `FetchBlobResponse` object as first argument. `FetchBlobResponse` object has the following methods (these method are synchronous, so you might take quite a performance impact if the file is big)
@@ -141,11 +150,9 @@ When `fetch` success, it resolve a `FetchBlobResponse` object as first argument.
141
150
returns json parsed object (done in js context)
142
151
#### text():string
143
152
returns decoded base64 string (done in js context)
0 commit comments