Beispiel #1
0
 protected IceRestClient() {
   ClientConfig clientConfig = new ClientConfig();
   clientConfig.register(IceAuthenticationFilter.class);
   clientConfig.register(PartDataJSONHandler.class);
   clientConfig.register(ArrayDataJSONHandler.class);
   clientConfig.register(MultiPartFeature.class);
   client = ClientBuilder.newClient(clientConfig);
 }
 public static String checkLogin(Userinfo ui) {
   Client client = ClientBuilder.newClient(config);
   WebTarget target = client.target(getBaseUri());
   return target
       .path("users")
       .path("role=" + ui.getUsertype())
       .path("email=" + ui.getUsername())
       .path("password=" + ui.getPassword())
       .request()
       .accept(MediaType.TEXT_HTML)
       .get(String.class);
 }
Beispiel #3
0
  private Client createClient() {
    ClientConfig config = new ClientConfig().register(JacksonJaxbJsonProvider.class);

    return ClientBuilder.newClient(config);
  }
Beispiel #4
0
 public MobileApi(String appUrl) {
   this.appUrl = appUrl;
   Client client = ClientBuilder.newClient();
   appTarget = client.target(this.appUrl);
 }