Interface HeaderProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface HeaderProvider
Functional interface for providing dynamic HTTP headers. Headers can be computed at request time, allowing for dynamic values like timestamps, request IDs, or rotating tokens.

 HeaderProvider provider = () -> Map.of(
     "X-Request-ID", UUID.randomUUID().toString(),
     "X-Timestamp", Instant.now().toString()
 );
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Provides headers for the HTTP request.
  • Method Details

    • getHeaders

      Map<String,String> getHeaders()
      Provides headers for the HTTP request. Called before each request, allowing dynamic header generation.
      Returns:
      Map of header names to values