Issue
I have method:
<https://uri:8080/getVer>
This method returns info about version of app. Like that:
1.39.1
It is text- not xml, not json, not html.
When I try to use this method in REST Assured:
RestAssured.given()
.log().uri()
.baseUri("https://uri:8080/")
.relaxedHTTPSValidation()
.get("getVer")
.then()
.log().all();
I do not recived a response body:
Logs from process:
Request URI: https://uri:8080/getVer HTTP/1.1 200 Content-Length: 6 X-Flow-Trace-Id: someTraceId Content-Type: application/json;charset=UTF-8 Date: Thu, 30 Dec 2021 19:27:03 GMT Set-Cookie: some_cookie; path=/; Httponly; Secure Server: some app server Process finished with exit code 0
Why i am not received response body? When I try to go to this link on my browser, I recieved a value.
Solution
Try this:
RestAssured.given()
.log().uri()
.baseUri("https://uri:8080/")
.relaxedHTTPSValidation()
.get("getVer")
.then()
.log().all()
.extract()
.response();
Answered By - Villa_7