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

Commit 0a7deb0

Browse files
committed
Update README.md
1 parent 2cf0e25 commit 0a7deb0

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,6 @@ Link package using [rnpm](https://github.com/rnpm/rnpm)
2121
rnpm link
2222
```
2323

24-
## API
25-
26-
#### `Promise<FetchBlobResponse> fetch(url, headers, body)`
27-
28-
Send a HTTP request uses given headers and body, and return a Promise.
29-
30-
#### url:`string` Required
31-
HTTP request destination url.
32-
#### headers:`object` (Optional)
33-
Headers of HTTP request, value of headers should be `stringified`.
34-
#### body:`string` (Optional)
35-
Body of the HTTP request, body MUST be a BASE64 string, this string will be converted into byte array in native code.
36-
37-
### FetchBlobResponse
38-
39-
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):
40-
41-
#### base64():string
42-
returns base64 string of response data (done in native context)
43-
#### json():object
44-
returns json parsed object (done in js context)
45-
#### text():string
46-
returns decoded base64 string (done in js context)
47-
#### blob():Blob
48-
returns Blob object (one in js context)
49-
5024
## Usage
5125

5226
```js
@@ -101,6 +75,32 @@ RNFetchBlob.fetch('POST', 'https://content.dropboxapi.com/2/files/upload', {
10175
})
10276
```
10377

78+
## API
79+
80+
#### `Promise<FetchBlobResponse> fetch(url, headers, body)`
81+
82+
Send a HTTP request uses given headers and body, and return a Promise.
83+
84+
#### url:`string` Required
85+
HTTP request destination url.
86+
#### headers:`object` (Optional)
87+
Headers of HTTP request, value of headers should be `stringified`.
88+
#### body:`string` (Optional)
89+
Body of the HTTP request, body MUST be a BASE64 string, this string will be converted into byte array in native code.
90+
91+
### FetchBlobResponse
92+
93+
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):
94+
95+
#### base64():string
96+
returns base64 string of response data (done in native context)
97+
#### json():object
98+
returns json parsed object (done in js context)
99+
#### text():string
100+
returns decoded base64 string (done in js context)
101+
#### blob():Blob
102+
returns Blob object (one in js context)
103+
104104
### TODO
105105

106106
* Save file to storage

0 commit comments

Comments
 (0)