Request body has csv content, but adding header as "text/csv" in rest assured still says to set content

39 views
Skip to first unread message

kuzhali.v...@gmail.com

unread,
Jun 13, 2023, 6:33:41 AM6/13/23
to REST assured
String body1 = "product,service,displayName,isHidden,description\n" +
"11AU,Test7,1,false,create q service\n" +
"11LBAND,Test8,1,false,create v service\n" +
"RTX NTRIP,Test9,1,false,create z service";

given().log().all()
.header("Content-Type", "text/csv")
.contentType("text/csv")
.body(body1)
.post("https://<url>")
.then().log().all();


Inspite of adding content-type, error is thrown as Bad request
"Content type is not sent in header 'content-type'"

Below is the Postman request which passes:

Capture.PNG

How to resolve it?


Reply all
Reply to author
Forward
0 new messages