top.jfunc.common.http.smart.SmartHttpTemplate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of httpclient Show documentation
Show all versions of httpclient Show documentation
http客户端请求工具类,有多种实现:OkHttp3、ApacheHttpClient、HttpURLConnection、Jodd-Http,可以随意切换http实现
package top.jfunc.common.http.smart;
import top.jfunc.common.http.Method;
import top.jfunc.common.http.base.ContentCallback;
import top.jfunc.common.http.base.HttpTemplate;
import top.jfunc.common.http.base.ResultCallback;
import java.io.IOException;
/**
* @author xiongshiyan at 2019/4/2 , contact me with email [email protected] or phone 15208384257
*/
public interface SmartHttpTemplate extends HttpTemplate{
/**
* 使用Request来放请求数据
* @param request 请求参数
* @param method 请求方法
* @see SSLRequest
* @param contentCallback 内容处理器,处理文本或者文件上传
* @param resultCallback 结果处理器
* @throws IOException IOException
* @return R
*/
R template(Request request, Method method, ContentCallback contentCallback, ResultCallback resultCallback) throws IOException;
/*
default R template(Request request, Method method, ContentCallback contentCallback, ResultCallback resultCallback) throws IOException{
return template(request.getUrl() ,
method ,
request.getContentType() ,
contentCallback ,
request.getHeaders() ,
request.getConnectionTimeout() ,
request.getReadTimeout() ,
request.getResultCharset() ,
request.isIncludeHeaders() ,
resultCallback);
}
*/
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy