Open andrisi opened 4 years ago
+1
A simple workaround
import axios from 'axios';
import curlirize from 'axios-curlirize';
const request = axios.create({
adapter: config => Promise.resolve({ config })
})
curlirize(request);
request
.post('http://localhost:7500/', { dummy: 'data' }, {
curlirize: false
})
.then(res => {
console.log(res.config.curlCommand);
})
Would be useful if ther would be a utility method exposed that translates an axios request without running it. So not intercepting the axios request, just doing the translation, and from the request passed in, not the normalised/extended version that the interceptor gets. Thanks a million, it's great to see if someone provides a solution to an issue one has - even without this extra feature I described.