Class RequestHeader

java.lang.Object
enterprises.iwakura.kirara.core.RequestHeader

public class RequestHeader extends Object
Represents a request header with a key and value. This class is used to encapsulate HTTP request headers.
  • Constructor Details

    • RequestHeader

      public RequestHeader(@NonNull @NonNull String key, @NonNull @NonNull String value)
      Constructs a new RequestHeader instance with the specified key and value.
      Parameters:
      key - The header key.
      value - The header value.
  • Method Details

    • of

      public static RequestHeader of(@NonNull @NonNull String key, @NonNull @NonNull String value)
      Creates a new RequestHeader instance.
      Parameters:
      key - The header key.
      value - The header value.
      Returns:
      A new RequestHeader instance.
    • convertToMap

      public static Map<String,String> convertToMap(List<RequestHeader> headers)
      Handy method converting a list of RequestHeader objects to a Map. Supports multiple values for the same key by concatenating them with a comma.
      Parameters:
      headers - The list of RequestHeader objects to convert.
      Returns:
      A Map where the keys are the header keys and the values are the concatenated header values.