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

top.jfunc.http.smart.ApacheSmartHttpClient Maven / Gradle / Ivy

package top.jfunc.http.smart;

import org.apache.http.HttpRequest;
import top.jfunc.http.component.*;
import top.jfunc.http.component.apache.DefaultApacheBodyContentCallbackCreator;
import top.jfunc.http.component.apache.DefaultApacheUploadContentCallbackCreator;
import top.jfunc.http.component.apache.ApacheHttpRequestExecutor;

/**
 * 使用Apache HttpClient 实现的Http请求类
 * @author 熊诗言2020/12/01
 */
public class ApacheSmartHttpClient extends AbstractImplementSmartHttpClient {

    public ApacheSmartHttpClient(){
        super(new DefaultApacheBodyContentCallbackCreator(),
                new DefaultApacheUploadContentCallbackCreator(),
                new ApacheHttpRequestExecutor());
    }

    public ApacheSmartHttpClient(ContentCallbackCreator bodyContentCallbackCreator,
                                 ContentCallbackCreator uploadContentCallbackCreator,
                                 HttpRequestExecutor httpRequestExecutor) {
        super(bodyContentCallbackCreator, uploadContentCallbackCreator, httpRequestExecutor);
    }

    public ApacheSmartHttpClient(AssemblingFactory assemblingFactory,
                                 ContentCallbackCreator bodyContentCallbackCreator,
                                 ContentCallbackCreator uploadContentCallbackCreator,
                                 HttpRequestExecutor httpRequestExecutor) {
        super(assemblingFactory, bodyContentCallbackCreator, uploadContentCallbackCreator, httpRequestExecutor);
    }

    @Override
    public String toString() {
        return "SmartHttpClient implemented by Apache's httpcomponents";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy