MediaTypeNegotiator

org.apache.pekko.http.scaladsl.server.MediaTypeNegotiator
final class MediaTypeNegotiator(requestHeaders: Seq[HttpHeader])

Attributes

Source
ContentNegotiation.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def isAccepted(mediaType: MediaType): Boolean

Determines whether the given pekko.http.scaladsl.model.MediaType is accepted by the client.

Determines whether the given pekko.http.scaladsl.model.MediaType is accepted by the client.

Attributes

Source
ContentNegotiation.scala
def qValueFor(mediaType: MediaType): Float

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.

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.

Attributes

Source
ContentNegotiation.scala

Concrete fields

The media-ranges accepted by the client according to the given request headers, sorted by

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 the Accept header(s)

Attributes

Source
ContentNegotiation.scala