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...
A ladder is hung and a browser can access the exchange's website and open the market interface to get results, such as:https://api.binance.com/api/v3/ticker/price
Use curlhttps://api.binance.com/api/v3/ticker/priceThe result is that if curl cannot request or request fails, then the network of the ladder is not configured correctly.
Above, use the following code when both the browser and curl are normally accessible.
import requests
response = requests.get("http://api.binance.com/api/v3/ticker/price")
print(response.text)
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.
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.