EntityDecoder

EntityDecoder is used to attempt to decode an EntityBody This companion object provides a way to create new EntityDecoders along with some commonly used instances which can be resolved implicitly.

EntityDecoder is used to attempt to decode an EntityBody This companion object provides a way to create new EntityDecoders along with some commonly used instances which can be resolved implicitly.

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_], T](ev: EntityDecoder[F, T]): EntityDecoder[F, T]

summon an implicit EntityDecoder

summon an implicit EntityDecoder

def binFile[F[_]](file: File, blocker: Blocker)(F: Sync[F], cs: ContextShift[F]): EntityDecoder[F, File]
def collectBinary[F[_]](m: Media[F])(`evidence$3`: Sync[F]): DecodeResult[F, Chunk[Byte]]

Helper method which simply gathers the body into a single Chunk

Helper method which simply gathers the body into a single Chunk

def decodeBy[F[_], T](r1: MediaRange, rs: MediaRange*)(f: Media[F] => DecodeResult[F, T])(`evidence$2`: Applicative[F]): EntityDecoder[F, T]

Create a new EntityDecoder

Create a new EntityDecoder

The new EntityDecoder will attempt to decode messages of type T only if the Message satisfies the provided MediaRange.

Exceptions thrown by f are not caught. Care should be taken that recoverable errors are returned as a DecodeResult#failure, or that system errors are raised in F.

def decodeText[F[_]](m: Media[F])(F: Sync[F], defaultCharset: Charset): F[String]

Decodes a message to a String

Decodes a message to a String

def error[F[_], T](t: Throwable)(F: Sync[F]): EntityDecoder[F, T]

Provides a mechanism to fail decoding

Provides a mechanism to fail decoding

def mixedMultipart[F[_]](blocker: Blocker, headerLimit: Int, maxSizeBeforeWrite: Int, maxParts: Int, failOnLimit: Boolean)(`evidence$9`: Sync[F], `evidence$10`: ContextShift[F]): EntityDecoder[F, Multipart[F]]
def textFile[F[_]](file: File, blocker: Blocker)(F: Sync[F], cs: ContextShift[F]): EntityDecoder[F, File]

Deprecated methods

@deprecated("Use `binary` instead", "0.19.0-M2")
def binaryChunk[F[_]](`evidence$5`: Sync[F]): EntityDecoder[F, Chunk[Byte]]
Deprecated

Implicits

Implicits

implicit def binary[F[_]](`evidence$4`: Sync[F]): EntityDecoder[F, Chunk[Byte]]
implicit def byteArrayDecoder[F[_]](`evidence$6`: Sync[F]): EntityDecoder[F, Array[Byte]]
implicit def charArrayDecoder[F[_]](`evidence$7`: Sync[F]): EntityDecoder[F, Array[Char]]
implicit def multipart[F[_]](`evidence$8`: Sync[F]): EntityDecoder[F, Multipart[F]]
implicit def semigroupKForEntityDecoder[F[_]](`evidence$1`: Functor[F]): SemigroupK[[_] =>> EntityDecoder[F, _$5]]
implicit def text[F[_]](F: Sync[F], defaultCharset: Charset): EntityDecoder[F, String]
implicit def void[F[_]](`evidence$11`: Sync[F]): EntityDecoder[F, Unit]

An entity decoder that ignores the content and returns unit.

An entity decoder that ignores the content and returns unit.