public final class HttpHeaders extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPT_ENCODING |
static String |
AUTHORIZATION |
static String |
CONTENT_ENCODING |
static String |
CONTENT_LENGTH |
static String |
CONTENT_TYPE |
static String |
USER_AGENT |
static String |
X_CORRELATION_ID |
Modifier and Type | Method and Description |
---|---|
static HttpHeaders |
empty() |
boolean |
equals(Object o) |
Optional<String> |
findFlatHeader(String key)
Finds the first header value for a certain key.
|
List<String> |
getHeader(String key)
Gets the header as list since they can occur multiple times.
|
Map<String,List<String>> |
getHeadersAsMap() |
int |
hashCode() |
static HttpHeaders |
of() |
static HttpHeaders |
of(List<NameValuePair> headers) |
static HttpHeaders |
of(Map<String,List<String>> headers) |
static HttpHeaders |
of(String key,
String value) |
static HttpHeaders |
ofMapEntryList(List<Map.Entry<String,String>> entries) |
HttpHeaders |
plus(String key,
String value) |
String |
toString() |
public static final String ACCEPT_ENCODING
public static final String AUTHORIZATION
public static final String USER_AGENT
public static final String CONTENT_ENCODING
public static final String CONTENT_TYPE
public static final String CONTENT_LENGTH
public static final String X_CORRELATION_ID
public static HttpHeaders of(List<NameValuePair> headers)
public static HttpHeaders of(Map<String,List<String>> headers)
public static HttpHeaders of(String key, String value)
public static HttpHeaders empty()
public static HttpHeaders of()
public List<String> getHeader(String key)
key
- the key of the header to findpublic Optional<String> findFlatHeader(String key)
key
- the key of the header to findpublic HttpHeaders plus(String key, String value)
public final String toString()
public static HttpHeaders ofMapEntryList(List<Map.Entry<String,String>> entries)