首页 > 编程语言 > 详细

Python执行web接口测试用例时,POST请求返回报文报“{"msg":"JSON parse error: Cannot construct instance of `xxxxx` }

时间:2021-02-04 21:00:56      阅读:551      评论:0      收藏:0      [点我收藏+]

使用Python+unittest完成web接口测试用例,调用post方法是,一直返回错误报文:

{"msg":"JSON parse error: Cannot construct instance of `xxxxx` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (‘‘); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `xxxxx` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (‘‘)\n at [Source: (PushbackInputStream); line: 1, column: 1]","code":500,"data":null

技术分享图片

 

 

 

纠结了很久,网上也查询了,也请教了Java开发,结果发现是post请求的参数写错导致,心中顿时几千万个那什么呼啸而过,这个问题的原因也太简单了,也是因为自己对各个请求方法的传参不够熟练导致(但是这个错误提示也够奇葩的,直接提示我参数传递错误就行呀。。。)

错误的请求样例:技术分享图片

正确的请求样例:技术分享图片

 

Python执行web接口测试用例时,POST请求返回报文报“{"msg":"JSON parse error: Cannot construct instance of `xxxxx` }

原文:https://www.cnblogs.com/ydyf/p/14374258.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!