public static void main(String[] args) {
HttpsURLConnection con = null;
BufferedReader in = null;
//ResultStaffSet resultSet= null;
System.setProperty("javax.net.debug", "all");
try {
String result = "";
String url = "https://us.zhcw.com/api-user/userbaseinfo/findUserInfoById";
String param = "";
TLS12ProtocolSocketFactory tls12ProtocolSocketFactory = new TLS12ProtocolSocketFactory();
Protocol.registerProtocol("https", new Protocol("https", tls12ProtocolSocketFactory, 443));
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, "UTF-8");
System.out.println(url);
PostMethod httpMethod = new PostMethod(url);
httpMethod.addRequestHeader("accept", "*/*");
httpMethod.addRequestHeader("connection", "Keep-Alive");
httpMethod.addRequestHeader("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
httpMethod.addRequestHeader("Accept-Charset", "UTF-8");
httpMethod.addRequestHeader("Content-Type", "application/json");
HttpMethodParams httpParams = new HttpMethodParams();
httpMethod.setRequestBody(param);
httpMethod.setParams(httpParams);
try {
httpClient.executeMethod(httpMethod);
result = httpMethod.getResponseBodyAsString();
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}