mirror of
https://github.com/tenrok/axios.git
synced 2026-05-21 13:24:11 +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
|
||||
var instance = axios.create({
|
||||
baseURL: 'https://some-domain.com/api/',
|
||||
timeout: 1000,
|
||||
headers: {'X-Custom-Header': 'foobar'}
|
||||
});
|
||||
@@ -165,6 +166,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: '/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: 'get', // default
|
||||
|
||||
Reference in New Issue
Block a user