定义和使用
requests.get(url, params={key: value}, args)
get方法给特定的url发送一个GET请求
参数详解:
url:必须。请求url
params:字典。list of tuples or bytes to send as a query string.Default None
headesr:Optional. A dictionary of HTTP headers to send to the specified url.
Default None
timeout:Optional. A number, or a tuple, indicating how many seconds to wait for the client to make a connection and/or send a response.
Default None which means the request will continue until the connection is closed
requests.post(url, data={key: value}, json={key: value}, args)
The post() method sends a POST request to the specified url.
The post() method is used when you want to send some data to the server.
url Required. The url of the request
data Optional. A dictionary, list of tuples, bytes or a file object to send to the specified url
也可以加入headers,cookies