http请求传参

请求源代码

#apifox默认参数data,遇到json格式服务器会报错,能成功的是因为没用json
response = requests.request("POST", url, headers=headers, data=payload)
#post还是json保险
response = requests.request("POST", url, headers=headers,json=payload)

响应错误

"msg": "服务器操作异常 : JSON parse error: Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN; nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN\n at [Source: (PushbackInputStream); line: 1, column: 6]"

}

posted @ 2023-06-21 16:10  测试-连环  阅读(5)  评论(0编辑  收藏  举报
访问主页 w