python3中post和get请求处理
post 请求处理
def url():
url = "www.xxx.com.cn"
data = {
"csrfmiddlewaretoken":"qGLEc713lNum7u0M1ddsXrsqb9WPEr7nuErl9M6XayHfnx2D1t80cLETVuF6MYwr",
"username":"admin",
"password":"123456",
"next":"%2Fadmin%2F"
}
response = requests.post(url_1,headers=headers,data = data)
get 请求处理
def get_url():
url = "www.xxx.com.cn"
response = requests.get(url=url,headers=headers)