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

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

Go to download

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

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

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * 结果封装,更通用的封装方式,输入更通用,自己转化成需要的数据结构string、bytes、file...
 * @author xiongshiyan at 2018/6/7
 */
@FunctionalInterface
public interface ResultCallback {
    /**
     * 转换结果
     * @param statusCode 返回码
     * @param stream body,代表输入流,自己转化成需要的数据结构string、bytes、file...
     * @param resultCharset 编码
     * @param headers headers
     * @return 
     * @throws IOException IOException
     * @see top.jfunc.common.http.smart.Response
     */
    R convert(int statusCode , InputStream stream, String resultCharset, Map> headers) throws IOException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy