public interface HttpHeaders
| Modifier and Type | Method and Description |
|---|---|
void |
add(String headerName,
List<String> values)
Adds a List of values for a header name to this object.
|
void |
add(String headerName,
String value)
Adds a value for a header name to this object, neither headerName nor value can be null.
|
void |
addAll(HttpHeaders headers)
Adds all the entries in a Headers object to this object.
|
void |
addAllFromMap(Map<String,String> headers)
Adds values from a Map to this object.
|
void |
addAllFromMultiMap(Map<String,List<String>> headers)
Adds values from a simulated Multi-Map to this object.
|
Map<String,List<String>> |
asMultimap()
Returns a simulated MultiMap of the headers.
|
Map<String,String> |
asSimpleMap()
Returns a Map of the headers, giving only one value for each header name.
|
boolean |
has(String headerName)
Use to check if the given name is present in headers.
|
Set<String> |
names()
Returns a Set containing all header names.
|
List<String> |
remove(String headerName)
Removes the mapping for a header name if it is present, and get the value to which this map
previously associated the key, or null if the map contained no mapping for the key.
|
String |
value(String headerName)
Get the first value associated with a given header name, or null if the header name is not
found.
|
List<String> |
values(String headerName)
Get a List of all values associated with a given header name, or null if the header name is
not found.
|
boolean has(String headerName)
headerName - String name for header to be checked.Set<String> names()
String value(String headerName)
headerName - The header name to find the associated value for.List<String> values(String headerName)
headerName - The header name to find the associated values for.Map<String,String> asSimpleMap()
Map<String,List<String>> asMultimap()
void add(String headerName, String value)
headerName - The header name to add the value against.value - The value to add.void add(String headerName, List<String> values)
headerName - The header name to add the values against.values - The List of values to add.void addAllFromMap(Map<String,String> headers)
headers - A Map containing header names and values as Entry pairs.void addAllFromMultiMap(Map<String,List<String>> headers)
headers - A Map containing header names and values as Entry pairs.void addAll(HttpHeaders headers)
headers - The object whose values are to be added to this object.List<String> remove(String headerName)
headerName - The header name to remove the associated values forCopyright © 2025. All rights reserved.