Package javax.ws.rs.core
Interface HttpHeaders
public interface HttpHeaders
An injectable interface that provides access to HTTP header information.
All methods throw java.lang.IllegalStateException if called outside the scope of a request
(e.g. from a provider constructor).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.8">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.28">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44">HTTP/1.1 documentation}.static final String
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.47">HTTP/1.1 documentation}. -
Method Summary
Modifier and TypeMethodDescriptionGet a list of languages that are acceptable for the response.Get a list of media types that are acceptable for the response.Get any cookies that accompanied the request.Get the language of the request entityGet the media type of the request entitygetRequestHeader
(String name) Get the values of a HTTP request header.Get the values of HTTP request headers.
-
Field Details
-
ACCEPT
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">HTTP/1.1 documentation}.- See Also:
-
ACCEPT_CHARSET
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2">HTTP/1.1 documentation}.- See Also:
-
ACCEPT_ENCODING
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3">HTTP/1.1 documentation}.- See Also:
-
ACCEPT_LANGUAGE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">HTTP/1.1 documentation}.- See Also:
-
AUTHORIZATION
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.8">HTTP/1.1 documentation}.- See Also:
-
CACHE_CONTROL
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">HTTP/1.1 documentation}.- See Also:
-
CONTENT_ENCODING
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11">HTTP/1.1 documentation}.- See Also:
-
CONTENT_LANGUAGE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12">HTTP/1.1 documentation}.- See Also:
-
CONTENT_LENGTH
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13">HTTP/1.1 documentation}.- See Also:
-
CONTENT_LOCATION
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14">HTTP/1.1 documentation}.- See Also:
-
CONTENT_TYPE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">HTTP/1.1 documentation}.- See Also:
-
DATE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18">HTTP/1.1 documentation}.- See Also:
-
ETAG
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19">HTTP/1.1 documentation}.- See Also:
-
EXPIRES
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21">HTTP/1.1 documentation}.- See Also:
-
HOST
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23">HTTP/1.1 documentation}.- See Also:
-
IF_MATCH
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24">HTTP/1.1 documentation}.- See Also:
-
IF_MODIFIED_SINCE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25">HTTP/1.1 documentation}.- See Also:
-
IF_NONE_MATCH
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26">HTTP/1.1 documentation}.- See Also:
-
IF_UNMODIFIED_SINCE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.28">HTTP/1.1 documentation}.- See Also:
-
LAST_MODIFIED
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29">HTTP/1.1 documentation}.- See Also:
-
LOCATION
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30">HTTP/1.1 documentation}.- See Also:
-
USER_AGENT
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43">HTTP/1.1 documentation}.- See Also:
-
VARY
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44">HTTP/1.1 documentation}.- See Also:
-
WWW_AUTHENTICATE
See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.47">HTTP/1.1 documentation}.- See Also:
-
COOKIE
See {@link <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109}.- See Also:
-
SET_COOKIE
See {@link <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109}.- See Also:
-
-
Method Details
-
getRequestHeader
Get the values of a HTTP request header. The returned List is read-only. This is a shortcut forgetRequestHeaders().get(name)
.- Parameters:
name
- the header name, case insensitive- Returns:
- a read-only list of header values.
- Throws:
IllegalStateException
- if called outside the scope of a request
-
getRequestHeaders
MultivaluedMap<String,String> getRequestHeaders()Get the values of HTTP request headers. The returned Map is case-insensitive wrt keys and is read-only.- Returns:
- a read-only map of header names and values.
- Throws:
IllegalStateException
- if called outside the scope of a request
-
getAcceptableMediaTypes
Get a list of media types that are acceptable for the response.- Returns:
- a read-only list of requested response media types sorted according to their q-value, with highest preference first.
- Throws:
IllegalStateException
- if called outside the scope of a request
-
getAcceptableLanguages
Get a list of languages that are acceptable for the response.- Returns:
- a read-only list of acceptable languages sorted according to their q-value, with highest preference first.
- Throws:
IllegalStateException
- if called outside the scope of a request
-
getMediaType
MediaType getMediaType()Get the media type of the request entity- Returns:
- the media type or null if there is no request entity.
- Throws:
IllegalStateException
- if called outside the scope of a request
-
getLanguage
Locale getLanguage()Get the language of the request entity- Returns:
- the language of the entity or null if not specified
- Throws:
IllegalStateException
- if called outside the scope of a request
-
getCookies
Get any cookies that accompanied the request.- Returns:
- a read-only map of cookie name (String) to Cookie.
- Throws:
IllegalStateException
- if called outside the scope of a request
-