public class HttpClients extends Object
| 构造器和说明 |
|---|
HttpClients() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Response |
doFormPost(String url,
String params) |
static Response |
doHttpsPost(String url,
String keyStorePath,
String keyStorePassword,
String content) |
static Response |
doPost(String url,
String content) |
static Response |
doRequest(RequestSettings settings) |
static KeyStore |
getKeyStore(String password,
String keyStorePath)
获得KeyStore.
|
static HostnameVerifier |
getNoopHostnameVerifier() |
static SSLContext |
getNoopSSLContext() |
static X509TrustManager |
getNoopX509TrustManager() |
static SSLContext |
getSSLContext(String password,
String keyStorePath) |
static SSLContext |
getSSLContext(String password,
String keyStorePath,
String trustStorePath)
获得SSLSocketFactory.
|
static void |
initHttpsDefaultConfig(String password,
String keyStorePath,
String trustStorePath)
初始化HttpsURLConnection.
|
public static Response doFormPost(String url, String params) throws IOException, GeneralSecurityException
public static Response doPost(String url, String content) throws IOException, GeneralSecurityException
public static Response doHttpsPost(String url, String keyStorePath, String keyStorePassword, String content) throws IOException, GeneralSecurityException
public static Response doRequest(RequestSettings settings) throws IOException, GeneralSecurityException
public static HostnameVerifier getNoopHostnameVerifier()
public static X509TrustManager getNoopX509TrustManager()
public static SSLContext getNoopSSLContext() throws GeneralSecurityException
public static SSLContext getSSLContext(String password, String keyStorePath) throws GeneralSecurityException, IOException
public static SSLContext getSSLContext(String password, String keyStorePath, String trustStorePath) throws GeneralSecurityException, IOException
password - 密码keyStorePath - 密钥库路径trustStorePath - 信任库路径ExceptionGeneralSecurityExceptionIOExceptionpublic static KeyStore getKeyStore(String password, String keyStorePath) throws GeneralSecurityException, IOException
keyStorePath - 密钥库路径password - 密码ExceptionGeneralSecurityExceptionIOExceptionCopyright © 2024 fossc. All rights reserved.