Handling a body response as a string can be accomplished using BodyHandlers.ofString(), as shown in the following snippet of code:
HttpResponse<String> responseOfString
= client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Status code: " + responseOfString.statusCode());
System.out.println("Body: " + responseOfString.body());
For specifying a charset, call ofString(String s, Charset charset).