【发布时间】:2023-02-21 00:27:22
【问题描述】:
我有 REST api 的 URLs
http://myhost/path/{param1}/{param2}
我知道我可以自己进行 urlencode 和组合,可能是像requests.get alsready 这样的功能吗?
【问题讨论】:
-
只是常规的 Python 字符串格式?
requests.get(f'http://myhost/path/{param1}/{param2}')会将名为param1和param2的变量的值插入到适当的位置。
标签: python-3.x python-requests