|
@ -0,0 +1,22 @@ |
|
|
|
|
|
import requests |
|
|
|
|
|
|
|
|
|
|
|
def GetCoinInfo(coin, settle): |
|
|
|
|
|
url = "http://43.133.213.20:8001/api/v1/GetCoinInfo/" |
|
|
|
|
|
payload = {"coin": coin, "settle": settle} |
|
|
|
|
|
|
|
|
|
|
|
response = requests.post(url, json=payload, timeout=5) |
|
|
|
|
|
|
|
|
|
|
|
if response.status_code == 200: |
|
|
|
|
|
return response.json() |
|
|
|
|
|
else: |
|
|
|
|
|
print(f"Error: {response.status_code}, {response.json()}") |
|
|
|
|
|
return None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 示例参数 |
|
|
|
|
|
coin = "btc" |
|
|
|
|
|
settle = "usdt" |
|
|
|
|
|
|
|
|
|
|
|
# 发送请求 |
|
|
|
|
|
CoinInfo = GetCoinInfo(coin, settle) |
|
|
|
|
|
print(CoinInfo) |