ParametersRequestHeaders, ResponseHeaderspublic interface Headers extends Parameters
Parameters interface by adding methods convenient for HTTP headers.| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<java.lang.String> |
all(java.lang.String headerName) |
Returns an unmodifiable
List of all header fields - each element represents a value of a single header field
in the request. |
default java.util.Optional<java.lang.String> |
value(java.lang.String headerName) |
Returns a header value as a single
String potentially concatenated using comma character
from all header fields. |
default java.util.List<java.lang.String> |
values(java.lang.String headerName) |
Returns an unmodifiable
List of all comma separated header value parts - Such segmentation is NOT valid for
all header semantics, however it is very common. |
add, add, addAll, computeIfAbsent, computeSingleIfAbsent, first, put, put, putAll, putIfAbsent, putIfAbsent, remove, toMap, toUnmodifiableParametersjava.util.List<java.lang.String> all(java.lang.String headerName)
List of all header fields - each element represents a value of a single header field
in the request. Consider to use value(String) or values(String) method instead.
Always returns a List, which may be empty if the parameter is not present.
all in interface ParametersheaderName - the header nameList of values with zero or greater sizejava.lang.NullPointerException - if headerName is nullvalue(String),
values(String)default java.util.Optional<java.lang.String> value(java.lang.String headerName)
String potentially concatenated using comma character
from all header fields.
Accordingly to RFC2616, Message Headers:
Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)]. It MUST be possible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field-value to the first, each separated by a comma.
headerName - the header namejava.lang.NullPointerException - if headerName is nullall(String),
values(String)default java.util.List<java.lang.String> values(java.lang.String headerName)
List of all comma separated header value parts - Such segmentation is NOT valid for
all header semantics, however it is very common. Refer to actual header semantics standard/description before use.
Result is composed from all header fields with requested headerName where each header value is tokenized by
a comma character. Tokenization respects value quoting by double-quote character.
Always returns a List, which may be empty if the parameter is not present.
headerName - the header nameList of values with zero or greater size, never nulljava.lang.NullPointerException - if headerName is nullall(String),
value(String)Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.