public class HttpUrlConnectionUtil extends Object
HttpURLConnection相关工具| Constructor and Description |
|---|
HttpUrlConnectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
allowPatch()
增加支持的METHOD方法
此方法通过注入方式修改 HttpURLConnection中的methods静态属性,增加PATCH方法see: https://stackoverflow.com/questions/25163131/httpurlconnection-invalid-http-method-patch |
static void |
allowPatchQuietly()
增加支持的METHOD方法
此方法通过注入方式修改 HttpURLConnection中的methods静态属性,增加PATCH方法see: https://stackoverflow.com/questions/25163131/httpurlconnection-invalid-http-method-patch |
static HttpURLConnection |
openHttp(URL url,
Proxy proxy)
初始化http或https请求参数
有些时候https请求会出现com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl的实现,此为sun内部api,按照普通http请求处理 |
public static void allowPatchQuietly()
HttpURLConnection中的methods静态属性,增加PATCH方法public static void allowPatch()
HttpURLConnection中的methods静态属性,增加PATCH方法public static HttpURLConnection openHttp(URL url, Proxy proxy) throws IORuntimeException
url - 请求的URL,必须为httpproxy - 代理,无代理传nullHttpURLConnection,https返回HttpsURLConnectionIORuntimeException - IO异常Copyright © 2025. All rights reserved.