python + get requests-- request transmitted parameters

Requests params keyword allows you to use parameters to a string dictionary to provide these parameters.



For example, if you want to pass key1 = value1 and key2 = value2 to httpbin.org/ GET, then you can use the following code:

payload = {'key1': 'value1', 'key2': 'value2'}

resp = requests.get("http://httpbin.org/get", params=payload,timeout=0.5)

 

Guess you like

Origin www.cnblogs.com/xiaobaibailongma/p/12343947.html