📌  相关文章
📜  如何使用客户端和 webresource 对象进行 https 调用 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:12.643000             🧑  作者: Mango

代码示例1
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);