All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.jfunc.common.http.base.HttpTemplate Maven / Gradle / Ivy

Go to download

http客户端请求工具类,有多种实现:OkHttp3、ApacheHttpClient、HttpURLConnection、Jodd-Http,可以随意切换http实现

There is a newer version: 1.2.12
Show newest version
package top.jfunc.common.http.base;

import top.jfunc.common.http.Method;
import top.jfunc.common.utils.ArrayListMultimap;

import java.io.IOException;

/**
 * http请求的模板方法接口
 * @author xiongshiyan at 2018/6/19
 */
public interface HttpTemplate{
    /**
     * http请求的模板方法
     *
     * @param url URL
     * @param method 请求方法
     * @param contentType 请求体MIME类型
     * @param contentCallback 处理请求体的
     * @param headers headers
     * @param connectTimeout 连接超时时间
     * @param readTimeout 读取超时时间
     * @param resultCharset 结果字符集
     * @param includeHeaders 是否结果包含header
     * @param resultCallback 结果处理器
     * @param  处理的结果
     * @return 处理的结果
     * @throws IOException IOException
     */
     R template(String url, Method method, String contentType, ContentCallback contentCallback,
                   ArrayListMultimap headers, Integer connectTimeout, Integer readTimeout,
                   String resultCharset, boolean includeHeaders, ResultCallback resultCallback) throws IOException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy