I am trying to add dynamic Post response on one rest API URL(http:IP:9000/page
) with data as a JSON request in file format, So to add that file in post body I use the command:
{__$FileToString(C:\Users\user\Desktop\Test\${__eval(${Json_request.txt})},,)}
and the JSON file data is:
{
"User ID": 204120,
"name": "New User",
"Description": [{"john",204110,"robotics"},
{"smith",204111,"AI"},
{"Jack",204112,"Machinelearning"}]
"Status": "Post request Successfully"
}
But after running this script there is an error in the response body in view results tree:
{"timestamp":1574329356300,"status":400,"error":"Bad
Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException",
"message":"JSON parse error: Unexpected character ('_' (code 95)): was expecting double-quote to start field name; nested exception is
com.fasterxml.jackson.core.JsonParseException: Unexpected character
('_' (code 95)): was expecting double-quote to start field name\n at
[Source: java.io.PushbackInputStream@73210d3e; line: 1, column: 3]","path":"/page"}