@Ignore @Test public void testRequestGet() { final HttpBinClient httpBinClient = new HttpBinClient("http: try { httpBinClient.asyncRequestGet(new FutureCallback<ResponseHttpGet>() { @Override public void onSuccess(@Nullable ResponseHttpGet result) { if (result == null) { return; } System.out.println(result.toString()); } @Override public void onFailure(Throwable t) { System.out.println("err: " + t.toString()); } }); System.out.println("call ended"); } catch (HttpResponseException e) { e.printStackTrace(); } try { Thread.sleep(1000 * 5); } catch (InterruptedException e) { e.printStackTrace(); } }
public ResponseHttpGet requestGet() throws HttpResponseException { final Response response = restClient.target(apiRoot) .path("get") .queryParam("test", "abc", "test2", 1, "test3", true) .register(HttpAuthenticationFeature.basic("username", "password")) .request() .get(); final int responseStatus = response.getStatus(); if (responseStatus != Response.Status.OK.getStatusCode()) { throw new HttpResponseException(responseStatus, String.format("HTTP Error: %d", responseStatus)); } return response.readEntity(ResponseHttpGet.class); }
HttpBinClient { public ResponseHttpGet requestGet() throws HttpResponseException { final Response response = restClient.target(apiRoot) .path("get") .queryParam("test", "abc", "test2", 1, "test3", true) .register(HttpAuthenticationFeature.basic("username", "password")) .request() .get(); final int responseStatus = response.getStatus(); if (responseStatus != Response.Status.OK.getStatusCode()) { throw new HttpResponseException(responseStatus, String.format("HTTP Error: %d", responseStatus)); } return response.readEntity(ResponseHttpGet.class); } }
HttpBinClient { public ResponseHttpGet requestGet() throws HttpResponseException { final Response response = restClient.target(apiRoot) .path("get") .queryParam("test", "abc", "test2", 1, "test3", true) .register(HttpAuthenticationFeature.basic("username", "password")) .request() .get(); final int responseStatus = response.getStatus(); if (responseStatus != Response.Status.OK.getStatusCode()) { throw new HttpResponseException(responseStatus, String.format("HTTP Error: %d", responseStatus)); } return response.readEntity(ResponseHttpGet.class); } HttpBinClient(String apiRoot, RestClient restClient);  HttpBinClient();  HttpBinClient(String apiRoot); }
HttpBinClient { public ResponseHttpGet requestGet() throws HttpResponseException { final Response response = restClient.target(apiRoot) .path("get") .queryParam("test", "abc", "test2", 1, "test3", true) .register(HttpAuthenticationFeature.basic("username", "password")) .request() .get(); final int responseStatus = response.getStatus(); if (responseStatus != Response.Status.OK.getStatusCode()) { throw new HttpResponseException(responseStatus, String.format("HTTP Error: %d", responseStatus)); } return response.readEntity(ResponseHttpGet.class); } HttpBinClient(String apiRoot, RestClient restClient);  HttpBinClient();  HttpBinClient(String apiRoot); ResponseHttpGet requestGet(); void asyncRequestGet(FutureCallback<ResponseHttpGet> callback); }
HttpBinClient { public ResponseHttpGet requestGet() throws HttpResponseException { final Response response = restClient.target(apiRoot) .path("get") .queryParam("test", "abc", "test2", 1, "test3", true) .register(HttpAuthenticationFeature.basic("username", "password")) .request() .get(); final int responseStatus = response.getStatus(); if (responseStatus != Response.Status.OK.getStatusCode()) { throw new HttpResponseException(responseStatus, String.format("HTTP Error: %d", responseStatus)); } return response.readEntity(ResponseHttpGet.class); } HttpBinClient(String apiRoot, RestClient restClient);  HttpBinClient();  HttpBinClient(String apiRoot); ResponseHttpGet requestGet(); void asyncRequestGet(FutureCallback<ResponseHttpGet> callback);  }