Here is the JsonPayload that I am trying to post using Jmeter
{
"myProperties": {
"sample1": "sample2",
"sample3": "sample${myVariable}"
}
}
Before posting, i am generating a random variable and storing it in myVariable.
I see from Jmeter that the request is created like this when posted: and I am expecting it to work
{
"myProperties": {
"sample1": "sample2",
"sample3": "sample234"
}
}
But when checked in the server logs it is being sent as:
{\r\n
"myProperties": {\r\n
"sample1": "sample2",\r\n
"sample3": "sample234"\r\n
}\r\n
}
If I post the raw request(like below) - It works fine. Only when I introduce the variable it fails. Can somebody please help?
{
"myProperties": {
"sample1": "sample2",
"sample3": "sample234"
}
}
Try like this:
payload = "{\r\n \"name\": \"xyz\",\r\n \"amount\": \"9000\",\r\n \"userId\": \"60\"\r\n}"
Maybe It will helpful for you.