I run in container fake smtp and it has own api, but it's not readable and i dont need like 80% of response, so how i can use DTO to make response more readable and less verbose?
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:port/api/v2/messages"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
it responses huge json, i need to implement my DTO to make it more readable and remove unnecessary parts of json