Jersey客户端内部服务器错误后调用

时间:2016-07-01 05:05:52

标签: java jersey-2.0

public String makePostCall(String url, String username, String password
       ) throws NoSuchAlgorithmException,
        KeyManagementException, URISyntaxException {

    target = (WebTarget) getClientInstance().target(new URI(url));
    Map<String,String> input=new HashMap<String,String>();
    input.put("name","foo");
 Response   response = target.request("application/json")
         .post(Entity.entity(input,MediaType.APPLICATION_JSON_TYPE));
return response.readEntity(String.class);
}

0 个答案:

没有答案