Package io.micronaut.http.util
Class HttpHeadersUtil
java.lang.Object
io.micronaut.http.util.HttpHeadersUtil
Utility class to work with
HttpHeaders or HTTP Headers.- Since:
- 3.8.0
- Author:
- Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescriptionsplitAcceptHeader(@NonNull String text) Split an accept-x header and get the first component.static voidtrace(@NonNull org.slf4j.Logger log, @NonNull HttpHeaders httpHeaders) Trace HTTP Headers.static voidtrace(@NonNull org.slf4j.Logger log, @NonNull String name, @NonNull Function<String, List<String>> getAllHeaders) Trace HTTP Headers.static voidtrace(@NonNull org.slf4j.Logger log, @NonNull Supplier<Set<String>> namesSupplier, @NonNull Function<String, List<String>> getAllHeaders) Trace HTTP Headers.static voidtrace(@NonNull org.slf4j.Logger log, @NonNull Set<String> names, @NonNull Function<String, List<String>> getAllHeaders) Trace HTTP Headers.
-
Method Details
-
trace
public static void trace(@NonNull @NonNull org.slf4j.Logger log, @NonNull @NonNull HttpHeaders httpHeaders) Trace HTTP Headers.- Parameters:
log- LoggerhttpHeaders- HTTP Headers
-
trace
public static void trace(@NonNull @NonNull org.slf4j.Logger log, @NonNull @NonNull Set<String> names, @NonNull @NonNull Function<String, List<String>> getAllHeaders) Trace HTTP Headers.- Parameters:
log- Loggernames- HTTP Header namesgetAllHeaders- Function to get all the header values for a particular header name
-
trace
public static void trace(@NonNull @NonNull org.slf4j.Logger log, @NonNull @NonNull Supplier<Set<String>> namesSupplier, @NonNull @NonNull Function<String, List<String>> getAllHeaders) Trace HTTP Headers.- Parameters:
log- LoggernamesSupplier- HTTP Header names ProvidergetAllHeaders- Function to get all the header values for a particular header name
-
trace
public static void trace(@NonNull @NonNull org.slf4j.Logger log, @NonNull @NonNull String name, @NonNull @NonNull Function<String, List<String>> getAllHeaders) Trace HTTP Headers.- Parameters:
log- Loggername- HTTP Header namegetAllHeaders- Function to get all the header values for a particular header name
-
splitAcceptHeader
Split an accept-x header and get the first component. If the header is*, return null.- Parameters:
text- The input header- Returns:
- The first part of the header, or
nullif the header is* - Since:
- 4.0.0
-