26 lines
788 B
Java
26 lines
788 B
Java
package envoy;
|
|
|
|
import javax.ws.rs.client.Client;
|
|
import javax.ws.rs.client.ClientBuilder;
|
|
import javax.ws.rs.client.WebTarget;
|
|
import javax.ws.rs.core.Response;
|
|
|
|
/**
|
|
* Project: <strong>envoy-client</strong><br>
|
|
* File: <strong>EnvoyClient.java</strong><br>
|
|
* Created: <strong>28 Sep 2019</strong><br>
|
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
|
*/
|
|
public class EnvoyClient {
|
|
|
|
public static void main(String[] args) {
|
|
Client client = ClientBuilder.newClient();
|
|
WebTarget target = client.target("http://localhost:8080/envoy-server/rest/hello?name=InformatikAGNGL");
|
|
Response response = target.request().get();
|
|
String value = response.readEntity(String.class);
|
|
response.close();
|
|
|
|
System.out.printf("Response form server: %s%n", value);
|
|
}
|
|
}
|