int statusCode = res.getStatusLine().getStatusCode();Please refer for code
Is there any way to cast string to Response to use the predefined method getStatusCode() else any other way to fetch the status code?
CodePudding user response:
You can have both Response
and String
, for example.
Response response = given().patch();
int statusCode = response.statusCode();
String res = response.asString();