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

io.github.wooenrico.http.common.HttpExecutor Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package io.github.wooenrico.http.common;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;

/**
 * HttpExecutor
 */
public interface HttpExecutor {
    /**
     * 执行http请求
     *
     * @param httpRequest http请求内容
     * @return HttpResponse http响应
     * @throws Exception 异常
     */
    HttpResponse execute(HttpRequest httpRequest) throws Exception;

    /**
     * 异步执行http请求
     *
     * @param httpRequest http请求内容
     * @param executor    线程池
     * @return CompletableFuture of HttpResponse http响应
     */
    CompletableFuture execute(HttpRequest httpRequest, Executor executor);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy