public interface HttpHeaders
IllegalStateException
if called outside the scope of a request (e.g. from a provider constructor).Context
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACCEPT
|
static java.lang.String |
ACCEPT_CHARSET
|
static java.lang.String |
ACCEPT_ENCODING
|
static java.lang.String |
ACCEPT_LANGUAGE
|
static java.lang.String |
ALLOW
|
static java.lang.String |
AUTHORIZATION
|
static java.lang.String |
CACHE_CONTROL
|
static java.lang.String |
CONTENT_DISPOSITION
See IETF RFC-2183.
|
static java.lang.String |
CONTENT_ENCODING
|
static java.lang.String |
CONTENT_ID
See IETF RFC-2392.
|
static java.lang.String |
CONTENT_LANGUAGE
|
static java.lang.String |
CONTENT_LENGTH
|
static java.lang.String |
CONTENT_LOCATION
|
static java.lang.String |
CONTENT_TYPE
|
static java.lang.String |
COOKIE
See IETF RFC 2109.
|
static java.lang.String |
DATE
|
static java.lang.String |
ETAG
|
static java.lang.String |
EXPIRES
|
static java.lang.String |
HOST
|
static java.lang.String |
IF_MATCH
|
static java.lang.String |
IF_MODIFIED_SINCE
|
static java.lang.String |
IF_NONE_MATCH
|
static java.lang.String |
IF_UNMODIFIED_SINCE
|
static java.lang.String |
LAST_EVENT_ID_HEADER
"Last-Event-ID" HTTP request header name as defined by
SSE specification. |
static java.lang.String |
LAST_MODIFIED
|
static java.lang.String |
LINK
|
static java.lang.String |
LOCATION
|
static java.lang.String |
RETRY_AFTER
|
static java.lang.String |
SET_COOKIE
See IETF RFC 2109.
|
static java.lang.String |
USER_AGENT
|
static java.lang.String |
VARY
|
static java.lang.String |
WWW_AUTHENTICATE
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.util.Locale> |
getAcceptableLanguages()
Get a list of languages that are acceptable for the response.
|
java.util.List<MediaType> |
getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response.
|
java.util.Map<java.lang.String,Cookie> |
getCookies()
Get any cookies that accompanied the request.
|
java.util.Date |
getDate()
Get message date.
|
java.lang.String |
getHeaderString(java.lang.String name)
Get a HTTP header as a single string value.
|
java.util.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.
|
java.util.List<java.lang.String> |
getRequestHeader(java.lang.String name)
Get the values of a HTTP request header.
|
MultivaluedMap<java.lang.String,java.lang.String> |
getRequestHeaders()
Get the values of HTTP request headers.
|
static final java.lang.String ACCEPT
static final java.lang.String ACCEPT_CHARSET
static final java.lang.String ACCEPT_ENCODING
static final java.lang.String ACCEPT_LANGUAGE
static final java.lang.String ALLOW
static final java.lang.String AUTHORIZATION
static final java.lang.String CACHE_CONTROL
static final java.lang.String CONTENT_DISPOSITION
static final java.lang.String CONTENT_ENCODING
static final java.lang.String CONTENT_ID
static final java.lang.String CONTENT_LANGUAGE
static final java.lang.String CONTENT_LENGTH
static final java.lang.String CONTENT_LOCATION
static final java.lang.String CONTENT_TYPE
static final java.lang.String DATE
static final java.lang.String ETAG
static final java.lang.String EXPIRES
static final java.lang.String HOST
static final java.lang.String IF_MATCH
static final java.lang.String IF_MODIFIED_SINCE
static final java.lang.String IF_NONE_MATCH
static final java.lang.String IF_UNMODIFIED_SINCE
static final java.lang.String LAST_MODIFIED
static final java.lang.String LOCATION
static final java.lang.String LINK
static final java.lang.String RETRY_AFTER
static final java.lang.String USER_AGENT
static final java.lang.String VARY
static final java.lang.String WWW_AUTHENTICATE
static final java.lang.String COOKIE
static final java.lang.String SET_COOKIE
static final java.lang.String LAST_EVENT_ID_HEADER
"Last-Event-ID"
HTTP request header name as defined by
SSE specification.java.util.List<java.lang.String> getRequestHeader(java.lang.String name)
getRequestHeaders().get(name)
.name
- the header name, case insensitive.java.lang.IllegalStateException
- if called outside the scope of a request.java.lang.String getHeaderString(java.lang.String name)
Get a HTTP header as a single string value.
Each single header value is converted to String using aRuntimeDelegate.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<java.lang.String,java.lang.String> getRequestHeaders()
null
.java.lang.IllegalStateException
- if called outside the scope of a request.java.util.List<MediaType> getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response.
If no acceptable media types are specified, a read-only list containing a singlewildcard media type
instance is returned.java.lang.IllegalStateException
- if called outside the scope of a request.java.util.List<java.util.Locale> getAcceptableLanguages()
Get a list of languages that are acceptable for the response.
If no acceptable languages are specified, a read-only list containing a single wildcardLocale
instance (with language field set to "*
") is returned.java.lang.IllegalStateException
- if called outside the scope of a request.MediaType getMediaType()
null
if there is no request entity.java.lang.IllegalStateException
- if called outside the scope of a request.java.util.Locale getLanguage()
null
if not specified.java.lang.IllegalStateException
- if called outside the scope of a request.java.util.Map<java.lang.String,Cookie> getCookies()
java.lang.IllegalStateException
- if called outside the scope of a requestjava.util.Date getDate()
null
if not present.int getLength()