public class SimpleHttp extends Object implements SimpleHttp
| Modifier and Type | Field and Description |
|---|---|
static SimpleHttp |
HTTP
create http
|
private static AbstractSimpleHttp |
proxy |
| Constructor and Description |
|---|
SimpleHttp() |
public static final SimpleHttp HTTP
private static AbstractSimpleHttp proxy
private void selectHttpProxy()
private <T extends AbstractSimpleHttp> AbstractSimpleHttp getHttpProxy(Class<T> clazz)
private void checkHttpNotNull(SimpleHttp proxy)
public SimpleHttp setHttp(AbstractSimpleHttp http)
public SimpleHttp setHttpConfig(HttpConfig config)
public SimpleHttp setHeader(HttpHeader header)
header - HttpHeaderSimpleHttppublic SimpleHttpResponse get(String url)
get in interface SimpleHttpurl - URLpublic SimpleHttpResponse get(String url, Map<String,String> params)
get in interface SimpleHttpurl - URLparams - 参数public SimpleHttpResponse post(String url)
post in interface SimpleHttpurl - URLpublic SimpleHttpResponse post(String url, String data)
post in interface SimpleHttpurl - URLdata - JSON 参数public SimpleHttpResponse post(String url, String dataJson, HttpHeader header)
SimpleHttppost in interface SimpleHttpurl - 请求地址dataJson - 请求参数,json格式header - 一次性请求头public SimpleHttpResponse postFormStr(String url, Map<String,String> params)
postFormStr in interface SimpleHttpurl - URLparams - form 参数public SimpleHttpResponse postFormStr(String url, Map<String,String> formData, HttpHeader header)
SimpleHttppostFormStr in interface SimpleHttpurl - 请求地址formData - 表单参数header - 请求头public SimpleHttpResponse postFile(String url, String name, String filename, byte[] fileBytes)
SimpleHttppostFile in interface SimpleHttpurl - 请求地址name - 参数名称filename - 文件名称fileBytes - 需要上传的文件public SimpleHttpResponse postFile(String url, String name, File file)
SimpleHttppostFile in interface SimpleHttpurl - 请求地址name - 参数名称file - 文件public SimpleHttpResponse postFormFile(String url, Map<String,Object> formData)
SimpleHttppostFormFile in interface SimpleHttpurl - urlformData - 文件上传参数public SimpleHttpResponse postFormFile(String url, Map<String,Object> formData, HttpHeader header)
SimpleHttppostFormFile in interface SimpleHttpurl - urlformData - 文件上传参数header - 请求头Copyright © 2023. All rights reserved.