- Enclosing class:
Http
public static sealed interface Http.HeaderName
HTTP header name.
-
Method Summary
Modifier and TypeMethodDescriptionHeader name as used in HTTP/1, or "human-readable" value of this header.default intindex()Index of this header (if one of the known indexed headers), or-1if this is a custom header name.default booleanHttp2 defines pseudoheaders as headers starting with a:character.Lowercase value of this header, used by HTTP/2, may be used for lookup by HTTP/1.default Http.HeaderValueCreate a new header with this name and the provided value.default Http.HeaderValueCreate a new header with this name and the provided value.default Http.HeaderValuewithValue(int value) Create a new header with this name and the provided value.default Http.HeaderValueCreate a new header with this name and the provided value.default Http.HeaderValueCreate a new header with this name and the provided value.
-
Method Details
-
lowerCase
String lowerCase()Lowercase value of this header, used by HTTP/2, may be used for lookup by HTTP/1. There is no validation of this value, so if this contains an upper-case letter, behavior is undefined.- Returns:
- name of the header, lowercase
-
defaultCase
String defaultCase()Header name as used in HTTP/1, or "human-readable" value of this header.- Returns:
- name of the header, may use uppercase and/or lowercase
-
index
default int index()Index of this header (if one of the known indexed headers), or-1if this is a custom header name.- Returns:
- index of this header
-
isPseudoHeader
default boolean isPseudoHeader()Http2 defines pseudoheaders as headers starting with a:character. These are used instead of the prologue line from HTTP/1 (to define path, authority etc.) and instead of status line in response.- Returns:
- whether this header is a pseudo-header
-
withValue
Create a new header with this name and the provided value. The header is considered not sensitive and not changing.- Parameters:
value- value of the header- Returns:
- a new cached HTTP header
- See Also:
-
withValue
Create a new header with this name and the provided value. The header is considered not sensitive and not changing.- Parameters:
value- value of the header- Returns:
- a new cached HTTP header
-
withValue
Create a new header with this name and the provided value. The header is considered not sensitive and not changing.- Parameters:
value- value(s) of the header- Returns:
- a new HTTP header
- See Also:
-
withValue
Create a new header with this name and the provided value.- Parameters:
changing- is this a header that changes value often (e.g. with every request); important for HTTP/2, where changing headers do not cache valuessensitive- is this a sensitive header, where we should not cache the value ever (such as security token)value- value of the header- Returns:
- a new cached HTTP header
-
withValue
Create a new header with this name and the provided value.- Parameters:
changing- is this a header that changes value often (e.g. with every request); important for HTTP/2, where changing headers do not cache valuessensitive- is this a sensitive header, where we should not cache the value ever (such as security token)value- value(s) of the header- Returns:
- a new HTTP header
-