public class HutoolImpl extends AbstractSimpleHttp implements IHutoolHttp
| Modifier and Type | Field and Description |
|---|---|
private cn.hutool.http.HttpRequest |
request |
header, httpConfig| Constructor and Description |
|---|
HutoolImpl() |
HutoolImpl(HttpConfig httpConfig) |
HutoolImpl(cn.hutool.http.HttpRequest httpRequest) |
HutoolImpl(cn.hutool.http.HttpRequest httpRequest,
HttpConfig config) |
| Modifier and Type | Method and Description |
|---|---|
private SimpleHttpResponse |
exec(cn.hutool.http.HttpRequest request) |
SimpleHttpResponse |
get(String url)
get 请求
|
SimpleHttpResponse |
get(String url,
Map<String,String> params)
get 请求
|
private String |
getContentType(String defaultContentType) |
private cn.hutool.http.HttpRequest |
getRequest(cn.hutool.core.net.url.UrlBuilder url,
cn.hutool.http.Method method) |
SimpleHttpResponse |
post(String url)
post请求
|
SimpleHttpResponse |
post(String url,
String dataJson)
post请求
|
SimpleHttpResponse |
post(String url,
String dataJson,
HttpHeader header)
post请求
|
SimpleHttpResponse |
postFile(String url,
String name,
File file)
post multipart/form-data 文件上传
|
SimpleHttpResponse |
postFile(String url,
String name,
String filename,
byte[] fileBytes)
post multipart/form-data 文件上传
|
SimpleHttpResponse |
postFormFile(String url,
Map<String,Object> formData)
post multipart/form-data 文件上传
|
SimpleHttpResponse |
postFormFile(String url,
Map<String,Object> formData,
HttpHeader header)
post multipart/form-data 文件上传
|
SimpleHttpResponse |
postFormStr(String url,
Map<String,String> formdata)
post 表单请求
|
SimpleHttpResponse |
postFormStr(String url,
Map<String,String> formData,
HttpHeader header)
post 表单请求
|
getHttpConfig, setHeader, setHttpConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHttpRequest, urlBuilderpublic HutoolImpl()
public HutoolImpl(HttpConfig httpConfig)
public HutoolImpl(cn.hutool.http.HttpRequest httpRequest)
public HutoolImpl(cn.hutool.http.HttpRequest httpRequest,
HttpConfig config)
public SimpleHttpResponse get(String url)
SimpleHttpget in interface SimpleHttpurl - 请求地址public SimpleHttpResponse get(String url, Map<String,String> params)
SimpleHttpget in interface SimpleHttpurl - 请求地址params - 请求参数public SimpleHttpResponse post(String url)
SimpleHttppost in interface SimpleHttpurl - 请求地址public SimpleHttpResponse post(String url, String dataJson)
SimpleHttppost in interface SimpleHttpurl - 请求地址dataJson - 请求参数,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> formdata)
SimpleHttppostFormStr in interface SimpleHttpurl - 请求地址formdata - 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 - 请求头private SimpleHttpResponse exec(cn.hutool.http.HttpRequest request)
private cn.hutool.http.HttpRequest getRequest(cn.hutool.core.net.url.UrlBuilder url,
cn.hutool.http.Method method)
Copyright © 2023. All rights reserved.