Modify requestBody structure

13 views
Skip to first unread message

Niko Kovac

unread,
May 25, 2018, 9:20:44 AM5/25/18
to Gatling User Group
Hey!
Let's say I have a JSON file with the following structure: 

{
 
"firstName": "${firstName}",
 
"lastName" : "${lastName}",
 
"age"      : ${age},
 
"address"  : {
   
"streetAddress": "${street}",
   
"city"         : "${city}",
   
"postalCode"   : "${postal}"
 
}
}


I can make a POST request and use the file above, like this:

.body(ElFileBody("myFileBody.json")).asJSON


But is it possible to modify json body structure before making a request? For example, I don't need to send a postalCode field every time. What is the right way to remove $.address.postalCode node before request sending?
Reply all
Reply to author
Forward
0 new messages