Exchange interface localization quick search when hanging ladder error Max retries exceed with url troubleshooting

Author: The Little Seven, Created: 2022-11-30 06:38:03, Updated: 2022-11-30 09:45:01

It took some time to solve the problem, and here's how to save time for students who have the same problem:

The FMZ platform is not easy to start and check the error logs

So, to access the exchange interface locally in Python for quick verification, accessing the binary, OK, and tokens all encountered the problem of... Max retries exceed with url...

Problems in the environment

import requests

response = requests.get("http://api.binance.com/api/v3/ticker/price")
print(response.text)

The Solution

In Python code requests, the address of the agent is added to specify the network agent, but the problem with this is that local testing requires an agent, while deployment to FMZ or a cloud server may not require an agent, and the associated code must be removed at the time of deployment.

proxies = {
          "http":"http://127.0.0.1:33210", # 改为自己本地梯子代理的端口号
          "https":"http://127.0.0.1:33210" # 改为自己本地梯子代理的端口号
      }

response = requests.get("http://api.binance.com/api/v3/ticker/price", proxies=proxies)
print(response.text)

The above is just a personal attempt, if it doesn't work, please forgive me, thank you.


More

Inventors quantifiedThanks for sharing, python itself is powerful, if other languages can be directly distributed using HttpQuery support go proxy What's that? HttpQuery (("socks5://127.0.0.1:8889/http://www.baidu.com/") What's that? If you want to join Adaptive, you can first use Dial to determine if the proxy server is open, if not, it is an online environment, you can do without adding proxy protocol prefix.

The Little SevenI learned, thank you.