Issue
I am using axios and axios-curlirize npm libraries in my code. It is working for all API calls. But one of my API is using a proxy, when I hit that API axios-curlirize package prints curl request for it in console, but it doesn't print the complete curl request for that API including the proxy settings.
I want to get the complete curl request with proxy settings in it.
I am using these libraries. When I make a hit to my API, I get this in console.
import axios from 'axios';
import curlirize from 'axios-curlirize';
curlirize(axios);
curl -X GET "http://host:port/url" -H "Authorization:Basic token"
But I am not getting the complete curl request with proxy settings in it.
Solution
There is no support for proxy in axios-curlirize.
You can use -x arg on the command line for proxy parameters.
curl -x 'http://proxy_host:proxy_port' 'http://api_host:api_port/some-url' -H "Authorization:Basic some_token"
Answered By - M. Hamza Rajput Answer Checked By - David Goodson (WPSolving Volunteer)