I am performance testing our Enterprise API using Gatling. While testing with "Postman" I used to pass following Headers:
- API Key
- Authorization Bearer Token
It would be great if someone could help me: How can I pass "API-KEY" and "Authorization Bearer" token as a header in a Gatling request?
Please see my code below:
val headers_10 = Map("Content-Type" -> """application/json""")
val httpConf = http
.baseURL(perfProdURL)
.acceptHeader("application/json, */*")
.acceptCharsetHeader("UTF-8")
val scn = scenario("Vertex API Test01")
.exec(
http("request_1")
.post("/details/orders")
.headers(headers_10)
.check(status.is(200))
.body(RawFileBody("/Users/z063011/Sunil/test.json")).asJSON)
val headers_10 = Map("Content-Type" -> """application/json""", "API-KEY" -> "your_api_key", "Authorization Bearer" -> "auth_bearer")
? – Phonolog