Package io.micronaut.http.client
Class ClientAttributes
java.lang.Object
io.micronaut.http.client.ClientAttributes
Client-related attribute accessors.
- Since:
- 4.8.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Optional<MethodInvocationContext<?,
?>> getInvocationContext
(@NonNull HttpRequest<?> request) Get the invocation context.static void
setInvocationContext
(@NonNull HttpRequest<?> request, @NonNull MethodInvocationContext<?, ?> invocationContext) Set the invocation context.static void
setServiceId
(@NonNull HttpRequest<?> request, @NonNull String serviceId) Set the client service ID.
-
Method Details
-
setServiceId
public static void setServiceId(@NonNull @NonNull HttpRequest<?> request, @NonNull @NonNull String serviceId) Set the client service ID.- Parameters:
request
- The requestserviceId
- The client service ID- See Also:
-
getInvocationContext
@NonNull public static @NonNull Optional<MethodInvocationContext<?,?>> getInvocationContext(@NonNull @NonNull HttpRequest<?> request) Get the invocation context.- Parameters:
request
- The request- Returns:
- The invocation context, if present
-
setInvocationContext
public static void setInvocationContext(@NonNull @NonNull HttpRequest<?> request, @NonNull @NonNull MethodInvocationContext<?, ?> invocationContext) Set the invocation context.- Parameters:
request
- The requestinvocationContext
- The invocation context
-