CharsetNegotiator

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

Attributes

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

Members list

Value members

Concrete methods

def isAccepted(charset: HttpCharset): Boolean

Determines whether the given charset is accepted by the client.

Determines whether the given charset is accepted by the client.

Attributes

Source
ContentNegotiation.scala

Picks the charset that is most preferred by the client with a bias towards UTF-8, i.e. if the client accepts all charsets with equal preference then UTF-8 is picked. If the client doesn't accept any charsets the method returns None.

Picks the charset that is most preferred by the client with a bias towards UTF-8, i.e. if the client accepts all charsets with equal preference then UTF-8 is picked. If the client doesn't accept any charsets the method returns None.

See also: http://tools.ietf.org/html/rfc7231#section-5.3.3

Attributes

Source
ContentNegotiation.scala
def qValueFor(charset: HttpCharset): Float

Returns the q-value that the client (implicitly or explicitly) attaches to the given charset. 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 charset. See http://tools.ietf.org/html/rfc7231#section-5.3.1 for details.

Attributes

Source
ContentNegotiation.scala

Concrete fields

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

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

  1. increasing generality (i.e. most specific first)
  2. decreasing q-value (only for ranges targeting a single HttpCharset)
  3. order of appearance in the Accept-Charset header(s)

Attributes

Source
ContentNegotiation.scala