I've tried in postman successfully,by adding Header"Content-Type=application/x-www-form-urlencoded" with x-www-form-urlencoded body.Apparently, this was my first time working on rest. Please advise me that below my code is correct or not. Thank You.
RestAssured.baseURI = AssignConfig.app.getProperty("RestURL");
Response request = RestAssured
.given()
.config(RestAssured.config()
.encoderConfig(EncoderConfig.encoderConfig()
.encodeContentTypeAs("x-www-form-urlencoded", ContentType.URLENC)))
.contentType("application/x-www-form-urlencoded; charset=UTF-8")
.header("Content-Type", "application/x-www-form-urlencoded")
.formParam("login","userName")
.formParam("password","password")