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); }
private Client createClient() { ClientConfig config = new ClientConfig().register(JacksonJaxbJsonProvider.class); return ClientBuilder.newClient(config); }
public MobileApi(String appUrl) { this.appUrl = appUrl; Client client = ClientBuilder.newClient(); appTarget = client.target(this.appUrl); }