Skip to content

Commit

Permalink
Update README.md: baseURL parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nickuraltsev committed Nov 22, 2015
1 parent 435636c commit 2ab201f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -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'}
});
Expand All @@ -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
Expand Down

0 comments on commit 2ab201f

Please sign in to comment.