raxios
v1.0.10
Published
Axios library with support of url params match
Downloads
5
Readme
raxios
Raxios is a wrapper of axios extending some functionallity of url pattern matching used in express library.
Installation
npm install --save raxios
Usage
import raxios from 'raxios'
raxios.get('http://myapi.com/:foo/search', {
urlParams: {
foo: 'bar'
}
}).then(res => console.log(res.data))
This will produce a request to http://myapi.com/bar/search
Usage with query params
import raxios from 'raxios'
raxios.get('http://myapi.com/:foo/search', {
urlParams: {
foo: 'bar'
},
params: {
q: 'soccer'
}
}).then(res => console.log(res.data))
This will produce a request to http://myapi.com/bar/search?q=soccer