What could cause "connect ETIMEDOUT" error when the URL is working in browser?
When behind a proxy you need to make the following modifications (as explained in this answer):
- put the proxy host in the
host
parameter - put the proxy port in the
port
parameter - put the full destination URL in the
path
parameter :
Which gives:
var options = {
host: '<PROXY_HOST>',
port: '<PROXY_PORT>',
path: 'http://www.boardgamegeek.com/xmlapi/boardgame/1?stats=1',
method: 'GET',
headers: {
Host: 'www.boardgamegeek.com'
}
}
If this error occurs while using POSTMAN.
So, when you call a request in Postman and the API requires your VPN to be up before you can make a successful call. You will need to connect or reconnect your VPN.
In my case, I was working on a company's laptop. I found out it was the VPN that was down.
In my case it was because of http
but not https
as required