public class HttpURLConnectionUtils extends Object
| 构造器和说明 |
|---|
HttpURLConnectionUtils() |
public static HttpURLConnection getConnection(String targetUrl, String method, Map<String,String> headers)
targetUrl - method - headers - public static HttpURLConnection getConnection(URL httpURL, String method, Map<String,String> headers)
httpURL - method - headers - public static String get(String url, Map<String,Object> param)
url - param - MalformedURLExceptionpublic static HttpResponse get(String targetUrl, Map<String,String> header, Map<String,Object> body)
public static void setHeaders(HttpURLConnection httpConnection, Map<String,String> header)
httpConnection - header - public static String post(String targetUrl, Map<String,String> headers, Map<String,Object> params)
public static StringBuffer buildHttpQueryParams(Map<String,Object> param)
public static HttpURLConnection execute(String targetUrl, String method, Map<String,String> headers, Map<String,Object> body) throws MalformedURLException
public static HttpURLConnection executeGet(String targetUrl, String method, Map<String,String> headers, Map<String,Object> reqParam)
public static HttpURLConnection executeValues(String targetUrl, String method, Map<String,String> headers, Map<String,String[]> reqMap)
targetUrl - method - headers - reqMap - public static HttpURLConnection execute(String targetUrl, String method, Map<String,String> headers, InputStream reqInputStream)
targetUrl - method - headers - reqInputStream - MalformedURLExceptionpublic static void disconnect(HttpURLConnection httpURLConnection)
Copyright © 2022. All rights reserved.