Interface HttpClientInterceptor
- All Known Implementing Classes:
ApiKeyHttpClientInterceptor,BasicAuthHttpClientInterceptor,BearerAuthHttpClientInterceptor,RootUriInterceptor,TelemetryInterceptor
public interface HttpClientInterceptor
Русский: Аннотация позволяет указывать обработчики HTTP ответов на определенные HTTP статус коды
English: Annotation allows you to specify HTTP response handlers for specific HTTP status codes
Пример / Example:
English: Annotation allows you to specify HTTP response handlers for specific HTTP status codes
Пример / Example:
public final class MyHttpClientInterceptor implements HttpClientInterceptor {
@Override
public CompletionStage<HttpClientResponse> processRequest(Context ctx, InterceptChain chain, HttpClientRequest request) throws Exception {
return chain.process(ctx, request);
}
}
@HttpClient(configPath = "my.config")
public interface MyHttpClient {
@InterceptWith(MyHttpClientInterceptor.class)
@HttpRoute(method = HttpMethod.GET, path = "/foo/bar")
HttpResponseEntity<String> get();
}
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpClientInterceptornoop()processRequest(ru.tinkoff.kora.common.Context ctx, HttpClientInterceptor.InterceptChain chain, HttpClientRequest request)
-
Method Details
-
processRequest
CompletionStage<HttpClientResponse> processRequest(ru.tinkoff.kora.common.Context ctx, HttpClientInterceptor.InterceptChain chain, HttpClientRequest request) throws Exception - Throws:
Exception
-
noop
-