如何在scala中集成post请求体中的变量值



我想在我的post请求体中使用变量的值,但我不知道我该怎么做,因为我已经使用csv文件作为feeder来获取我的查询参数的所有其他值,期望一个参数应该具有值currentTime:

所以我将这个变量设置为:

var currentTime = ZonedDateTime.now()

然后post request的body中是

.body(StringBody(“”"{keys: value gotten from csv file timeNow: ( here I want to put the value of my variable currentTime)}“”")

如何将变量currentTime的值集成为body查询的参数值

最简单的方法:使用内置的Gatling表达式语言函数之一,如currentTimeMillis()currentDate(<pattern>)

最新更新