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
A Blob implementation on node.js, originally from node-fetch
4
11
5
-
See [MDN doc](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and [Tests](https://github.com/bitinn/fetch-blob/blob/master/test.js) for details
12
+
## Usage
13
+
14
+
```sh
15
+
$ npm install fetch-blob
16
+
```
17
+
18
+
```js
19
+
constBlob=require('fetch-blob');
20
+
constfetch=require('node-fetch');
21
+
fetch('https://httpbin.org/post', {
22
+
method:'POST',
23
+
body:newBlob(['hello'], { type:'text/plain' })
24
+
})
25
+
.then(res=>res.json()) // expecting a json response
26
+
.then(json=>console.log(json));
27
+
```
28
+
29
+
See [MDN doc](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and [Tests](https://github.com/bitinn/fetch-blob/blob/master/test.js) for more details.
0 commit comments