Следующие проходы (взяты из https://gatling.io/docs/2.3/http/http_request/, удалены .toJSON
, поскольку он не существует), но не добавляют запись в API REST:
class TestREST extends Simulation {
val httpProtocol = http
.baseUrl("http://127.0.0.1:5000") // Here is the root for all relative URLs
val scn = scenario("UploadMany") // A scenario is a chain of requests and pauses
.exec(http("request_1")
.put("/")
.body(StringBody("""{
"text":"lalala", "title": "hello world", "date": "12346"}"""))
.check(status.is(200))
)
setUp(scn.inject(atOnceUsers(1)).protocols(httpProtocol))
}
Как добавитьДанные JSON в .put
запрос с Gatling?