Python代码发送post请求接口测试

  • Post author:
  • Post category:python



参考代码

# coding:utf-8
import requests
url = "https://passport.cnblogs.com/user/signin"  # 接口地址

# 消息头数据
headers = {
            'Connection': 'keep-alive',
            'Content-Length': '123',
            'Cache-Control': 'max-age=0',
            'Origin':'https://passport.csdn.net',
            'Upgrade-Insecure-Requests':'1',
            'Content-Type': 'application/x-www-form-urlencoded',
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
            'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
            'Referer': 'https://passport.csdn.net/account/login?from=http://www.csd



版权声明:本文为yang520java原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。