Working on a small project on sentiment analysis on movie reviews. I am passing JSON data to RestAPI hosted in my local machine. I wanted to perform load test using gatling tool, here is my code,
class BasicSimulation extends Simulation {
val httpConf = http
.baseURL(“http://localhost:10050/sentiment”)
val scn = scenario(“test”)
.exec(http(“request_1”)
.post(“http://localhost:10050/sentiment”)
.body(StringBody("""{ “inputData”: “Amazing movie” }""")).asJSON)
.pause(7)
setUp(scn.inject(atOnceUsers(30)).protocols(httpConf)}
In Gatling tool test, getting no errors in HTTP request , but getting error in HTTP Response as follows, “HTTP response: status= 406 Not Acceptable” and
ResponseProcessor - Request ‘request_1’ failed: status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 406.
Server end receives http request without any exception and tried printing inputData too, which works fine. But only in HTTP response I’m getting "HTTP/1.1 406 Not Acceptable "