我python写了一个对接网站api接口交易的程序,大部分都搞定了,就是切换endpoint没成功。请问怎么用函数来切换endpoint对应的网址?(网址1切换成网址2,网址需要带引号)
from pybit import spot # 引入pybit现货
bybit = spot.HTTP(
endpoint="某网址1",
apikey="12345",
apisecret="67890"
)
我用endpoint=apis
然后用函数控制apis变量为'网址1'或'网址2',
但会报错
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL 'dfs/spot/v1/account': No scheme supplied. Perhaps you meant hp://dfs/spot/v1/account?
请问如何解决,十分感谢!