const axios = require('axios@0.20.0')
const instance = axios.create( {
baseURL: 'https://www.some-domain.com/',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
data: { 'form-field1' : 'value 1' },
adapter(config) {
console.log('config in adapter:', config)
const response = {
data: 'OK'
};
return Promise.resolve(response)
}
})
instance('/some/resource/', {
data: { 'form-field1' : 'value 1' }
})
instance.delete('/some/resource/', {
data: { 'form-field1' : 'value 1' }
})