Added Maven project

This commit is contained in:
2019-09-28 11:51:52 +02:00
parent a05136517c
commit f8a2126f10
8 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,25 @@
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);
}
}