📅  最后修改于: 2022-03-11 14:48:12.643000             🧑  作者: Mango
Client client = Client.create();
WebResource webResource = client.resource("uri");
MultivaluedMap queryParams = new MultivaluedMapImpl();
queryParams.add("json", js); //set parametes for request
appKey = "Bearer " + appKey; // appKey is unique number
//Get response from RESTful Server get(ClientResponse.class);
ClientResponse response = webResource.queryParams(queryParams)
.header("Content-Type", "application/json;charset=UTF-8")
.header("Authorization", appKey)
.get(ClientResponse.class);
String jsonStr = response.getEntity(String.class);