, but actually found 400 while im trying post method so what its the solve?

package com.gatling.tests.api

//import io.gatling.core.scenario.Simulation
import io.gatling.core.Predef._
import io.gatling.http.Predef._

class postapi11 extends Simulation{
  val httpProtocol = http
  val scn11 = scenario("Create User")
      actionBuilder = http("create user req  ")
        .post("/users") //end point
        .header(name="content-type",value="application/json" )
            |    "name": "morpheus",
            |    "job": "leader"
        .check (status is 201 ,
          jsonPath("$.name") is "morpheus"

  setUp (
    //scn.inject(atOnceUsers(users = 10))
    scn11.inject(rampUsers(users = 5).during(5))

thats my script hope you to help me

Hi @sajeda,

What do you want from the gatling community?

The code feels right.
The results is correct.
Your server answer with a 400 but your simulation expects a 201.

Nothing the gatling community can do for you.
You’ll have to ensure that your body is expected from your server.

Note: no need to manually add the content-type header when you use asJson.


400 means “bad Request”, typically meaning your JSON payload is malformed.

          """" <= 4 doubles quotes here, instead of 3!!!
            |    "name": "morpheus",
            |    "job": "leader"

You have an extra double quote before your JSON object!