2
0
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:
Nick Uraltsev
2015-11-22 01:32:59 -08:00
parent 435636c714
commit 2ab201f049
+6
View File
@@ -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