mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Update README.md: baseURL parameter
This commit is contained in:
@@ -140,6 +140,7 @@ You can create a new instance of axios with a custom config.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
var instance = axios.create({
|
var instance = axios.create({
|
||||||
|
baseURL: 'https://some-domain.com/api/',
|
||||||
timeout: 1000,
|
timeout: 1000,
|
||||||
headers: {'X-Custom-Header': 'foobar'}
|
headers: {'X-Custom-Header': 'foobar'}
|
||||||
});
|
});
|
||||||
@@ -166,6 +167,11 @@ These are the available config options for making requests. Only the `url` is re
|
|||||||
// `url` is the server URL that will be used for the request
|
// `url` is the server URL that will be used for the request
|
||||||
url: '/user',
|
url: '/user',
|
||||||
|
|
||||||
|
// `baseURL` will be prepended to `url` unless `url` is absolute.
|
||||||
|
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
|
||||||
|
// to methods of that instance.
|
||||||
|
baseURL: 'https://some-domain.com/api/',
|
||||||
|
|
||||||
// `method` is the request method to be used when making the request
|
// `method` is the request method to be used when making the request
|
||||||
method: 'get', // default
|
method: 'get', // default
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user