java – How can I read body from Response from exception?

I make post request like this, which I got from other answers:

    WebClient client = tokenAuth.addAuthentication(WebClient.create(url))

    responseString =, String.class);
catch (WebApplicationException e) {
    Response response = e.getResponse();
    String message = response.readEntity(String.class); // THIS DOESN'T WORK!

However, response.readEntity(String.class) was having problem, so I read the log and it says this:

09/08/21 14:11:11.654 DEBUG http-nio-8080-exec-9 - Not injecting HSTS header since it did not match the requestMatcher$SecureRequestMatcher@6a382cea

I am guessing there is an issue with parsing the header, but not sure what is going on. Is there way to fix this or get a body from the response in my catch block?