客户端客户端= Client.create();
client.addFilter(new HTTPBasicAuthFilter("username", "password"));
WebResource resource = client.resource("https://server.location.path");
//WebResource.Builder builder=resource.getRequestBuilder().header("Authorization", "Basic Base64value");
ClientResponse response = resource.accept("application/json")
.get(ClientResponse.class);
System.out.println(response);
String output = response.getEntity(String.class);
System.out.println("Output from Server .... \n");
System.out.println(output);
我已经放置了代码,请告诉我你有什么建议吗