0

Rest assured - API how to use post query string I am unable to pass this. I have to check or uncheck manually.

Instead send data from media type we need to send data with Post query string:

 response = given() .header() .log() .when() .post() .then() 

enter image description here

1 Answer 1

1

It's just content-type application/x-www-form-urlencoded

For example:

given().log().all() .config(RestAssured.config() .encoderConfig(encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false))) .contentType(ContentType.URLENC) .formParam("name", "john.smith") .formParam("firstName", "john") .formParam("lastName", "Smith") .formParam("email", "[email protected]") .post("https://postman-echo.com/post") .prettyPrint(); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.