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)

posted @ 2019-11-20 12:30  g7y12  阅读(1440)  评论(0编辑  收藏  举报