Added Maven project
This commit is contained in:
25
src/main/java/envoy/EnvoyClient.java
Normal file
25
src/main/java/envoy/EnvoyClient.java
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user