提交 a8dab576 编写于 作者: M Matt Zabriskie 提交者: GitHub

Merge pull request #741 from model3volution/Update/readme

adding sample code to GET images
......@@ -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])
```js
......@@ -528,7 +540,7 @@ In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/
var params = new URLSearchParams();
params.append('param1', 'value1');
params.append('param2', 'value2');
axios.post('/foo', params);
axios.post('/foo', params);
```
> Note that `URLSearchParams` is not supported by all browsers, but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册