API connection via ipv6 vs. ipv4

Your machine currently has both IPv4 and IPv6 address configured, but your IPv6 connectivity is broken and connection attempts via IPv6 time out.

wget (and probably your Python code) is trying IPv6 first, timing out, then connecting successfully over IPv4. But it works when -4 forces the use of IPv4.

postman is likely either only using IPv4, or it is trying both IPv4 and IPv6 at the same time and using whichever connects first.

You’ll need to investigate why IPv6 connections don’t work on your network. Even if they fail immediately, that’s better since wget will know to immediately try via IPv4 rather than wait for IPv6.

(or, force your connections to IPv4-only)

9 Likes