About HTTP requires two jar packages Httpclient-4.0.jar Httpcore-4.0.1.jar private static final httpclient httpclient = new Defaulthttpclie
NT ();
try {//get keystore KeyStore Truststore = keystore.getinstance ("JKs");
String keystorefile = "Xxxxx.keystore";
String keypwd = "xxxxxxx";
FileInputStream instream = new FileInputStream (new File (Keystorefile));
Secret key Library Password truststore.load (instream, Keypwd.tochararray ());
Registered KeyStore sslsocketfactory socketfactory = new Sslsocketfactory (Truststore);
Do not verify domain name Socketfactory.sethostnameverifier (sslsocketfactory.allow_all_hostname_verifier);
Scheme sch = new scheme ("https", socketfactory, 443);
Httpclient.getconnectionmanager (). Getschemeregistry (). Register (Sch);
catch (Exception e) {e.printstacktrace ();
The following section is called code and can be written in many ways, not limited to httppost httppost HttpPost = new HttpPost (URL);
stringentity entity = new stringentity (params);
Entity.setcontentencoding ("UTF-8"); Httppost.setentiTy (entity);
Send Request HttpResponse response = Httpclient.execute (HttpPost);
String jsonstr = entityutils.tostring (Response.getentity ());