In Rest Assured framework we use POJO classes concept when there is a JSON payload. But right now I am having x-www-form-urlencoded form params. Is there any way we can use POJO classes for x-www-form-urlencoded form params? Please let me know the better way to handle x-www-form-urlencoded form params?
Currently I am handling in the below way.
.header("Content-Type", "application/x-www-form-urlencoded");
.formParam("i_username",username);
.formParam("i_password",password);
You can use Map<String, ?> to provide values for
formParams
.For example:
And if you still want to use POJO, you can write a small method to convert POJO to Map, then do it as the same above instruction.