Answers for "how to use client and webresource objects to do https call"

0

how to use client and webresource objects to do https call

Client client = Client.create();
WebResource webResource = client.resource("uri");

MultivaluedMap<String, String> 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);
Posted by: Guest on August-28-2020

Code answers related to "how to use client and webresource objects to do https call"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language