mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
Updating README
This commit is contained in:
@@ -83,6 +83,23 @@ axios.get('/user/12345')
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Performing multiple concurrent requests
|
||||||
|
|
||||||
|
```
|
||||||
|
function getUserAccount() {
|
||||||
|
return axios.get('/user/12345');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUserPermissions() {
|
||||||
|
return axios.get('/user/permissions/12345');
|
||||||
|
}
|
||||||
|
|
||||||
|
axios.all([getUserAccount(), getUserPermissions()])
|
||||||
|
.then(axios.spread(function (acct, perms) {
|
||||||
|
// Both requests are now complete
|
||||||
|
}));
|
||||||
|
```
|
||||||
|
|
||||||
## Request API
|
## Request API
|
||||||
|
|
||||||
Requests can be made by passing the relevant config to `axios`.
|
Requests can be made by passing the relevant config to `axios`.
|
||||||
@@ -110,6 +127,11 @@ For convenience aliases have been provided for all supported request methods.
|
|||||||
###### NOTE
|
###### NOTE
|
||||||
When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.
|
When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.
|
||||||
|
|
||||||
|
### Concurrency
|
||||||
|
|
||||||
|
##### axios.all(iterable)
|
||||||
|
##### axios.spread(callback)
|
||||||
|
|
||||||
### Config
|
### Config
|
||||||
|
|
||||||
This is the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified.
|
This is the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified.
|
||||||
|
|||||||
Reference in New Issue
Block a user