top.jfunc.http.smart.OkHttp3SmartHttpClient Maven / Gradle / Ivy
package top.jfunc.http.smart;
import okhttp3.Request;
import top.jfunc.http.component.*;
import top.jfunc.http.component.okhttp3.DefaultOkHttp3BodyContentCallbackCreator;
import top.jfunc.http.component.okhttp3.DefaultOkHttp3UploadContentCallbackCreator;
import top.jfunc.http.component.okhttp3.OkHttp3HttpRequestExecutor;
/**
* 使用OkHttp3实现的Http请求类
* @author 熊诗言2020/12/01
*/
public class OkHttp3SmartHttpClient extends AbstractImplementSmartHttpClient {
public OkHttp3SmartHttpClient(){
super(new DefaultOkHttp3BodyContentCallbackCreator(),
new DefaultOkHttp3UploadContentCallbackCreator(),
new OkHttp3HttpRequestExecutor());
}
public OkHttp3SmartHttpClient(ContentCallbackCreator bodyContentCallbackCreator,
ContentCallbackCreator uploadContentCallbackCreator,
HttpRequestExecutor httpRequestExecutor) {
super(bodyContentCallbackCreator, uploadContentCallbackCreator, httpRequestExecutor);
}
public OkHttp3SmartHttpClient(AssemblingFactory assemblingFactory,
ContentCallbackCreator bodyContentCallbackCreator,
ContentCallbackCreator uploadContentCallbackCreator,
HttpRequestExecutor httpRequestExecutor) {
super(assemblingFactory, bodyContentCallbackCreator, uploadContentCallbackCreator, httpRequestExecutor);
}
@Override
public String toString() {
return "SmartHttpClient implemented by square's OkHttp3";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy