axios + auto encode url + ...
npm install ata

- axios + auto encode url + ...
- fetch style requests with $ prefixed methods, like axios-module
- support string proxy config like 127.0.0.1:9000
``sh`
yarn add ataor
npm install ata
`js
const Ata = require('ata')
const url = 'http://httpbin.org/get?show_env=1'
async function go() {
// const { data } = await Ata.get(url)
const data = await Ata.$get(url)
console.log(data)
}
go()
`
`js
const Ata = require('ata')
const randomMua = require('random-mua')
Ata.interceptors.request.use(
function(config) {
if (!config.headers['User-Agent']) {
config.headers['User-Agent'] = randomMua()
}
return config
},
function(error) {
return Promise.reject(error)
}
)
``