001
002package io.vrap.rmf.base.client.http;
003
004import java.util.concurrent.CompletableFuture;
005import java.util.function.Function;
006
007import io.vrap.rmf.base.client.ApiHttpRequest;
008import io.vrap.rmf.base.client.ApiHttpResponse;
009
010/**
011 * Interface for a HTTP middleware used to modify a request and the response
012 */
013@FunctionalInterface
014public interface Middleware {
015
016    CompletableFuture<ApiHttpResponse<byte[]>> invoke(final ApiHttpRequest request,
017            final Function<ApiHttpRequest, CompletableFuture<ApiHttpResponse<byte[]>>> next);
018
019}