I'm making a GET REST call via HttpClient:
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(endpoint))
.GET()
.header("Authorization", authHeader)
.header("Content-Type", "application/json")
.build();
HttpResponse<String> response = client.send(
request, HttpResponse.BodyHandlers.ofString());
How can I map the response in the MyObject object? Is it correct to intercept it as a String first? also, I would need to pass a string as a path parameter, but I don't know where to add it.
Thanks for the support!!