我是加特林的新手。我正在尝试使用 Gatling 将 POST 消息发送到 HTTP API。我尝试了以下方法:
package app.basic
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class basicPost extends Simulation {
val headers_10 = Map("Content-Type" -> """application/json""")
object Post {
// repeat is a loop resolved at RUNTIME
val post = repeat(50) {
exec(http("Post Data")
.post("/data")
.queryParam("""size""", "10"))
.headers(headers_10)
.body("""{"id1":"0000000000"}""")
.pause(1)
}
}
val httpConf = http.baseURL("http://amazonperf-env.elasticbeanstalk.com")
val users = scenario("Users").exec(Post.post)
setUp(
users.inject(rampUsers(1000) over (10 seconds))
).protocols(httpConf)
}
但是,编译时出现此错误: value body is not a member of io.gatling.core.structure.ChainBuilder 可能的原因:可能在“value body”之前缺少分号?
如何指定要发送的邮件正文?