Package tech.mgl.utils.http
Class MGL_HttpUtils
java.lang.Object
tech.mgl.utils.http.MGL_HttpUtils
HttpUtils.java
- Version:
- TODO
- Author:
- bo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringaccess_with_ssl(String url, Map<String, Object> params) 安全请求链接static voiddownload(String url, String path, MGLRequestCallBack back) 下载文件static Stringstatic Stringget(String url, MGLRequestCallBack back) static voidstatic Stringstatic Stringpost(String url, Map<String, Object> params, InputStream cert, String certPwd, MGLRequestCallBack back) static Stringstatic Stringpost(String url, Map<String, Object> params, Map<String, String> header, InputStream cert, String certPwd, MGLRequestCallBack back) static Stringstatic Stringstatic Stringrequest(String url, MGL_HttpRequest.REQUEST_METHOD rMethod, Map<String, Object> params, Map<String, String> header, InputStream cert, String certPwd, MGLRequestCallBack back) 通过证书请求static String发生get请求static StringGET方式发送请求static StringGET方式发送请求static String* GET方式发送请求static String以POST方式访问远程服务器static String以POST方式访问远程服务器static String以POST方式访问远程服务器static StringsendWithDefault(String method, String url, StringBuilder parameter) Deprecated.static Stringstatic Stringupload(MGL_UploadBuilder uploadBuilder) 上传文件
-
Constructor Details
-
MGL_HttpUtils
public MGL_HttpUtils()
-
-
Method Details
-
main
- Throws:
IOException
-
access_with_ssl
安全请求链接@title :
@param url
@param params
@return
@throws Exception
@company :
@author : www.mgl.tech
@date : 2016 Apr 23, 2016 4:09:28 PM
@description :
@return : String
- Throws:
Exception
-
sendGet
GET方式发送请求- Returns:
- : String
- Throws:
Exception
-
sendGet
GET方式发送请求- Returns:
- : String
- Throws:
Exception
-
sendGet
public static String sendGet(String url, Map<String, String> params, Map<String, throws ExceptionString> header) * GET方式发送请求- Returns:
- : String
- Throws:
Exception
-
send
public static String send(String url, Map<String, String> params, Map<String, throws ExceptionString> header, String encode) 发生get请求- Returns:
- : String
- Throws:
Exception
-
sendPost
以POST方式访问远程服务器- Returns:
- : String
- Throws:
Exception
-
sendPost
以POST方式访问远程服务器- Returns:
- : String
- Throws:
Exception
-
sendPost
public static String sendPost(String url, Map<String, Object> params, Map<String, throws ExceptionString> header) 以POST方式访问远程服务器- Returns:
- : String
- Throws:
Exception
-
sendWithDefault
@Deprecated public static String sendWithDefault(String method, String url, StringBuilder parameter) Deprecated.普通方式发送内容- Parameters:
method-url-parameter-- Returns:
-
download
下载文件- Parameters:
url-path-- Throws:
IOException
-
upload
上传文件- Parameters:
uploadBuilder-- Throws:
IOException
-
get
- Parameters:
url-back-- Returns:
- Throws:
IOException
-
get
- Parameters:
url-- Returns:
- Throws:
IOException
-
post
public static String post(String url, Map<String, Object> params, InputStream cert, String certPwd, MGLRequestCallBack back) throws IOException- Parameters:
url-params-cert-certPwd-back-- Returns:
- Throws:
IOException
-
post
public static String post(String url, Map<String, Object> params, Map<String, throws IOExceptionString> header, InputStream cert, String certPwd, MGLRequestCallBack back) - Parameters:
url-params-header-cert-certPwd-back-- Returns:
- Throws:
IOException
-
post
public static String post(String url, Map<String, Object> params, MGLRequestCallBack back) throws IOException- Parameters:
url-params-back-- Returns:
- Throws:
IOException
-
post
- Throws:
IOException
-
postJson
- Throws:
IOException
-
post
public static String post(String url, Map<String, Object> params, Map<String, throws IOExceptionString> header) - Throws:
IOException
-
upload
- Throws:
IOException
-
request
public static String request(String url, MGL_HttpRequest.REQUEST_METHOD rMethod, Map<String, Object> params, Map<String, throws IOExceptionString> header, InputStream cert, String certPwd, MGLRequestCallBack back) 通过证书请求- Parameters:
url-cert-certPwd-- Returns:
- Throws:
IOException
-