Hello All,
I have a script which is hitting a API POST call and submit a CSR,when i run the same request from the Postman it worked fine and get the expected response.When i tried the same call from the Gatling script with required parameters first instance it failed with Request Time out error, then i updated the value for pooledConnectionIdleTimeout = 1200000 and requestTimeout = 1200000 and ran the script then i ran the script and again it failed with error -j.i.IOException: Premature close .
i tried to investigate this issue with different options and as per the so many update from forums but no luck as of now.I have no clue how to move forward.
Any help will be helpful and it will unblock my blocker issue.
@ksantosh1978 I’m sorry, but there’s really nothing we can do with screenshots. We’d need the actual Postman test and the ability to run it (is the API exposed on the internet?).
I start debugging the code with removing one by one header values in the request then when i removed the Content-Length parameter and ran the script it accepted the given payload and returned the expected response with 200 OK status…
I think we don’t understand each other.
I’m trying to understand how the explicit .header("Content-Length", 3000) header displayed in your screenshot made it here. I’m trying to understand if it was generated by the Recorder, or if you’re the one who erroneously added it.
Sorry for confusion. I have not used the Gatling recorder for the scripts and everything written manually.
.header(“Content-Length”, 3000) initially i have added as per the Postman header requirements but later i removed as script was failing due to this and throwing the Timeout and Premature close error.
In the current script i have not added the .header(“Content-Length”, xxxxx) attribute.
OK, not a Gatling bug then. Thanks for confirming.
What happened was that, as you enforced the Content-Length manually, Gatling would not compute it in your stead.
As a result, the request had a Content-Length different from the actual body’s, causing the server to crash it on its side.