Package enterprises.iwakura.kirara.core
Class RequestHeader
java.lang.Object
enterprises.iwakura.kirara.core.RequestHeader
Represents a request header with a key and value.
This class is used to encapsulate HTTP request headers.
-
Constructor Summary
ConstructorsConstructorDescriptionRequestHeader(@NonNull String key, @NonNull String value) Constructs a new RequestHeader instance with the specified key and value. -
Method Summary
Modifier and TypeMethodDescriptionconvertToMap(List<RequestHeader> headers) Handy method converting a list of RequestHeader objects to a Map.static RequestHeaderCreates a new RequestHeader instance.
-
Constructor Details
-
RequestHeader
Constructs a new RequestHeader instance with the specified key and value.- Parameters:
key- The header key.value- The header value.
-
-
Method Details
-
of
Creates a new RequestHeader instance.- Parameters:
key- The header key.value- The header value.- Returns:
- A new
RequestHeaderinstance.
-
convertToMap
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.
-