jmeter报错:JSON parse error: Unrecognized token ‘variable‘: was expecting (JSON String, Number,
发布日期:2023-03-25 18:20:58 浏览次数:7 分类:技术文章

本文共 1320 字,大约阅读时间需要 4 分钟。

全部报错信息

{"timestamp":"2022-09-17T11:03:44.368Z","status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"JSON parse error: Unrecognized token 'xxx': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'occurDateBegin': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n at [Source: (PushbackInputStream); line: 1, column: 16]","path":"/pss/cmfmcapitalliquidate/getDataImportData"}

百度了下,HTTP请求传参由Parameters改为Body Data就能解决问题,contenttype决定了入参格式,我的contenttype:application/json;charset=UTF-8,应该用消息体

复制了浏览器F12的消息体参数进jmeter消息体参数后又报错:

{"timestamp":"2022-09-17T11:24:36.322Z","status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"JSON parse error: Unexpected character ('o' (code 111)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('o' (code 111)): was expecting double-quote to start field name\n at [Source: (PushbackInputStream); line: 1, column: 3]","path":"/pss/cmfmcapitalliquidate/getDataImportData"}

是因为消息体中的参数名没有加引号,加了引号再执行,运行成功

转载地址:https://blog.csdn.net/qq_37090279/article/details/126903146 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Jmeter持续断言响应时间
下一篇:Jmeter抗压测试

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2024年05月04日 21时34分20秒