Hi,
I have a post request where i need to send x-www-form-urlencoded keyValue pair parameters and content-type should be x-www-form-urlencoded.
If i look to post man it will look like below


I am using below code:
RestAssured.baseURI = "
https://ww.abc.com";
RequestSpecification request = RestAssured.given().log().all().config(RestAssured.config()
.encoderConfig(EncoderConfig.encoderConfig()
.encodeContentTypeAs("x-www-form-urlencoded",
ContentType.URLENC)))
.contentType("x-www-form-urlencoded")
.formParam("abc", "def")
.formParam("hij", "xyz")
.formParam("123", "456")
.formParam("789", "222")
.formParam("password", "abc")
.header("accept", "application/json")
.header("123", "abc")
.header("456", "ttt")
.header("channel", "1111").request();
Response res =
request.post("/111");
When i check RestAssured logs it shows all parameters in Form params but parameters are sent as form-data not as x-www-form-urlencoded parameters.
Please do let me know is there any other way to send x-www-form-urlencoded parameters or some updation required in code.
Thanks in advance.