This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SwapiService swapiService = | |
RestClientBuilder.newBuilder() | |
.baseUrl(new URL("https://swapi.dev/api")) | |
.build(SwapiService.class); | |
JsonObject character = swapiService.getCharacter(id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package odelia.restclient; | |
import javax.inject.Inject; | |
import javax.json.JsonObject; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import org.eclipse.microprofile.rest.client.inject.RestClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package odelia.restclient; | |
import javax.json.JsonObject; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; |
OlderNewer