我有REST API,其URL如下
http://myhost/path/{param1}/{param2}
我知道我可以urlencode和组成它自己,可能是一些函数,如requests.get已经这样做了?
requests.get
ltskdhd11#
param1 = 'spaghetti' param2 = 'meatballs' print(f'http://myhost/path/{param1}/{param2}') # http://myhost/path/spaghetti/meatballs
1条答案
按热度按时间ltskdhd11#