public interface HttpHeaders
IllegalStateException
if called outside the
scope of a request (e.g. from a provider constructor).Context
Modifier and Type | Method and Description |
---|---|
List<Locale> |
getAcceptableLanguages()
Get a list of languages that are acceptable for the response.
|
List<MediaType> |
getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response.
|
Map<String,Cookie> |
getCookies()
Get any cookies that accompanied the request.
|
Date |
getDate()
Get message date.
|
String |
getHeaderString(String name)
Get a HTTP header as a single string value.
|
Locale |
getLanguage()
Get the language of the request entity.
|
int |
getLength()
Get Content-Length value.
|
MediaType |
getMediaType()
Get the media type of the request entity.
|
List<String> |
getRequestHeader(String name)
Get the values of a HTTP request header.
|
MultivaluedMap<String,String> |
getRequestHeaders()
Get the values of HTTP request headers.
|
static final String ACCEPT
static final String ACCEPT_CHARSET
static final String ACCEPT_ENCODING
static final String ACCEPT_LANGUAGE
static final String ALLOW
static final String AUTHORIZATION
static final String CACHE_CONTROL
static final String CONTENT_DISPOSITION
static final String CONTENT_ENCODING
static final String CONTENT_ID
static final String CONTENT_LANGUAGE
static final String CONTENT_LENGTH
static final String CONTENT_LOCATION
static final String CONTENT_TYPE
static final String DATE
static final String ETAG
static final String EXPIRES
static final String HOST
static final String IF_MATCH
static final String IF_MODIFIED_SINCE
static final String IF_NONE_MATCH
static final String IF_UNMODIFIED_SINCE
static final String LAST_MODIFIED
static final String LOCATION
static final String LINK
static final String RETRY_AFTER
static final String USER_AGENT
static final String VARY
static final String WWW_AUTHENTICATE
static final String COOKIE
static final String SET_COOKIE
static final String LAST_EVENT_ID_HEADER
"Last-Event-ID"
HTTP request header name as defined by
SSE specification.List<String> getRequestHeader(String name)
getRequestHeaders().get(name)
.name
- the header name, case insensitive.IllegalStateException
- if called outside the scope of a request.String getHeaderString(String name)
RuntimeDelegate.HeaderDelegate
if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString
method if a header
delegate is not available.name
- the HTTP header.null
is returned. If the HTTP header is present but has no
value then the empty string is returned. If the HTTP header is present
more than once then the values of joined together and separated by a ','
character.getRequestHeader(java.lang.String)
MultivaluedMap<String,String> getRequestHeaders()
null
.IllegalStateException
- if called outside the scope of a request.List<MediaType> getAcceptableMediaTypes()
wildcard media type
instance is returned.IllegalStateException
- if called outside the scope of a request.List<Locale> getAcceptableLanguages()
Locale
instance (with language field
set to "*
") is returned.IllegalStateException
- if called outside the scope of a request.MediaType getMediaType()
null
if there is no request entity.IllegalStateException
- if called outside the scope of a request.Locale getLanguage()
null
if not specified.IllegalStateException
- if called outside the scope of a request.Map<String,Cookie> getCookies()
IllegalStateException
- if called outside the scope of a requestDate getDate()
null
if not present.int getLength()
Copyright © 2019 Eclipse Foundation.
Use is subject to license terms.