2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

adding sample code to GET images

This commit is contained in:
Michael Liendo
2017-03-05 11:52:57 -06:00
parent fe810b1e3c
commit bf2163c68e
+12
View File
@@ -125,6 +125,18 @@ axios({
}); });
``` ```
```js
// GET request for remote image
axios({
method:'get',
url:'http://bit.ly/2mTM3nY',
responseType:'stream'
})
.then(function(response) {
response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
});
```
##### axios(url[, config]) ##### axios(url[, config])
```js ```js