Package akka.http.scaladsl.server
Class MediaTypeNegotiator
- java.lang.Object
-
- akka.http.scaladsl.server.MediaTypeNegotiator
-
public final class MediaTypeNegotiator extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MediaTypeNegotiator(scala.collection.immutable.Seq<HttpHeader> requestHeaders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.collection.immutable.List<MediaRange>
acceptedMediaRanges()
The media-ranges accepted by the client according to the given request headers, sorted by 1. increasing generality (i.e. most specific first) 2. decreasing q-value (only for ranges targeting a single MediaType) 3. order of appearance in theAccept
header(s)boolean
isAccepted(MediaType mediaType)
Determines whether the givenMediaType
is accepted by the client.float
qValueFor(MediaType mediaType)
Returns the q-value that the client (implicitly or explicitly) attaches to the given media-type.
-
-
-
Constructor Detail
-
MediaTypeNegotiator
public MediaTypeNegotiator(scala.collection.immutable.Seq<HttpHeader> requestHeaders)
-
-
Method Detail
-
acceptedMediaRanges
public scala.collection.immutable.List<MediaRange> acceptedMediaRanges()
The media-ranges accepted by the client according to the given request headers, sorted by 1. increasing generality (i.e. most specific first) 2. decreasing q-value (only for ranges targeting a single MediaType) 3. order of appearance in theAccept
header(s)- Returns:
- (undocumented)
-
isAccepted
public boolean isAccepted(MediaType mediaType)
Determines whether the givenMediaType
is accepted by the client.- Parameters:
mediaType
- (undocumented)- Returns:
- (undocumented)
-
qValueFor
public float qValueFor(MediaType mediaType)
Returns the q-value that the client (implicitly or explicitly) attaches to the given media-type. See http://tools.ietf.org/html/rfc7231#section-5.3.1 for details.- Parameters:
mediaType
- (undocumented)- Returns:
- (undocumented)
-
-