Hi,
I'm using the following code to validate the response
RestAssured.registerParser("text/plain", Parser.JSON);
response = given().filter(new myFilter())
.spec(myrRequestSpec)
.when()
.post();
It`s,work fine;
then I build a new response with following code
newResponse = new ResponseBuilder().clone(response)
.setBody("something.....")
.build();
When I run this , the following error is thrown:
java.lang.IllegalStateException: Expected response body to be verified as JSON, HTML or XML but content-type 'text/plain' is not supported out of the box.
Try registering a custom parser using:
RestAssured.registerParser("text/plain", );
I do not know why.
Any suggestions or hints are very welcome.
thanks
Hi,
I'm using the following code to validate the response
RestAssured.registerParser("text/plain", Parser.JSON);
response = given().filter(new myFilter())
.spec(myrRequestSpec)
.when()
.post();
It`s,work fine;
then I build a new response with following code
newResponse = new ResponseBuilder().clone(response)
.setBody("something.....")
.build();
When I run this , the following error is thrown:
java.lang.IllegalStateException: Expected response body to be verified as JSON, HTML or XML but content-type 'text/plain' is not supported out of the box.
Try registering a custom parser using:
RestAssured.registerParser("text/plain", );
I do not know why.
Any suggestions or hints are very welcome.
thanks