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 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
第一次来,支持一个
[***.219.124.196]2024年05月04日 21时34分20秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
在Debian 8上使用Apt-Get安装Java
2019-05-01
vs中动态DLL与静态LIB工程中加入版本信息的方法
2019-05-01
大数据分析技术与应用一站式学习(值得收藏)_v20200418
2019-05-01
Qt 在windows下的串口读写
2019-05-01
SpringApplication执行流程
2019-05-01
自定义Starter
2019-05-01
分布式事务原理探究(一)
2019-05-01
spring cloud consul 应用的多实例名的解决
2019-05-01
LeetCode 560 和为 k 的子数组
2019-05-01
MYSQL的身体,POSTGRESQL 的头脑
2019-05-01
PostgreSQL 高可用Patroni和学习方法
2019-05-01
业务卡单 与 MongoDB性能记录与分析
2019-05-01
MYSQL 中的查询技巧 与 MYSQL 8 并行查询
2019-05-01
java多线程-Thread类的一些基本API
2019-05-01
java多线程-线程的同步
2019-05-01
java 多线程之Exchanger
2019-05-01
java 多线程之Future与FutureTask
2019-05-01
人工智能为什么这么火?看看安防江湖30年血战就知道了
2019-05-01
“前端智能为安防产生新的数据价值”
2019-05-01
(3)CMake入门笔记--CMake官网教程
2019-05-01