public interface AcceptHeader extends MediaType, Parameters, Header
An AcceptHeader may be followed by one or more parameters applicable to the media-range. q-values allow the user to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1. (If no q-value is present, the media-range should be treated as having a q-value of 1.)
If no AcceptHeader is present in a Request, the server SHOULD assume a media of type "application" and subType "sdp". If an AcceptHeader is present, and if the server cannot send a response which is acceptable according to the combined Accept field value, then the server should send a Response message with a NOT_ACCEPTABLE status code.
For example:
Accept: application/sdp;level=1, application/x-private, text/html
Modifier and Type | Field and Description |
---|---|
static String |
NAME
Name of AcceptHeader
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowsAllContentSubTypes()
Gets boolean value to indicate if the AcceptHeader allows all media
sub-types, that is the content sub-type is "*".
|
boolean |
allowsAllContentTypes()
Gets boolean value to indicate if the AcceptHeader allows all media
types, that is the content type is "*".
|
float |
getQValue()
Gets q-value of media-range in AcceptHeader.
|
void |
setQValue(float qValue)
Sets q-value for media-range in AcceptHeader.
|
getContentSubType, getContentType, setContentSubType, setContentType
getParameter, getParameterNames, removeParameter, setParameter
static final String NAME
void setQValue(float qValue) throws InvalidArgumentException
qValue
- - the new float value of the q-value, a value of -1 resets
the qValue.InvalidArgumentException
- if the q parameter value is not
-1
or between 0 and 1
.float getQValue()
-1
indicates theq-value
is not set.boolean allowsAllContentSubTypes()
boolean allowsAllContentTypes()
Copyright © 2016. All Rights Reserved.