当前位置:网站首页>Automatic escape processing in JMeter
Automatic escape processing in JMeter
2022-07-24 00:02:00 【The test is super standard】
Before you say escape, briefly say Json data format :
natural Json The data looks like this :
{"msg":" Wrong password !","code":60016}But if you encounter such data :


Put it in JMeter There will be a mistake in the report ~
reason , stay Java in , The string is made up of the last two double quotes , When this format appears , Double quotation marks “ pairing ” error .
Solution 1: Yes Json Escape the data in , That is, add a... In the wrong double quotation mark position \ Transference .
{
"msg":" Wrong password !",
"code":60016,
"data":"{\"name\":\" The test is super standard \"}"
}
String b = {"msg":" Wrong password !","code":60016,"data":"{\"name\":\" The test is super standard \"}"};Solution 2: Use fastjson Provide methods to escape
import com.alibaba.fastjson.JSON;
//json The data is in sql After the query , You need to get content_json String type of
String dd = vars.getObject("sd").get(0).get("content_json");
// hold content_json Transference , Then put it into the request data , With escape \
vars.put("requestBody",JSON.toJSONString(dd));
边栏推荐
- Splicing of.Net distribution with outlook mail format and table
- DGS's mutations
- Esp8266 - at command + network transparent transmission
- kubernetes error
- Sentinel link mode flow control failure solution
- C language explanation series -- understanding of functions (2) how to use functions to exchange the values of two integer variables
- [microservice Architecture] distributed transactions
- DDD thinking structure learning
- 2022牛客多校联赛第二场 题解
- ciscn_ 2019_ n_ eight
猜你喜欢

ciscn_ 2019_ n_ one

jarvisoj_ level2

QT create a background mask, pop up the child window, and the background of the parent window turns black and dark

ciscn_ 2019_ c_ one

Sentinel链路方式流控失效解决

深度学习之 9 前馈神经网络2:实现前馈神经网络,模型调优

Linked list - 707. Design linked list

【译】Go RPC 入门:Hello World
![[attack and defense world web] difficulty five-star 15 point advanced question: bug](/img/24/4a7f074aac9a08130cf215f0c39b57.png)
[attack and defense world web] difficulty five-star 15 point advanced question: bug

Chapter 5: implementation of Web adapter
随机推荐
Tool recommendation - YuQue
Chapter 4: implementation use cases
logback
Structured streaming programming model (input table, result table, output mode...)
PyTorch 中遇到的问题
String function 1 of C language
在原生终端实现类似 rz、sz 上传下载文件与目录的功能
怎么开户买收益6%的理财产品呢?
Practical learning of SQL statements
FPGA——SPI总线控制flash(3)含代码
网上找客户经理办理基金开户安全吗??
为什么大多数人都认为编程很难?
C语言详解系列——函数的认识(2)如何使用函数实现交换两个整型变量的值
Super simple training of force deduction and problem brushing
logback
【OpenCV】- cv.threshold()函数的参数type是数字时,代表的含义
权重分析——CRITIC权重法
Iptables prevent nmap scanning and binlog
Is Zhongyuan securities reliable? Is it legal? Is it safe to open a stock account?
After openfeign sets circuitbreaker=true, feign's readtimeout expires