HeadersSchemaOps

zio.http.schema.HeadersSchemaOps
final class HeadersSchemaOps(headers: Headers) extends AnyVal

Attributes

Source
HeadersSchemaOps.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def header[T](name: String)(implicit schema: Schema[T]): Either[HeaderError, T]

Attributes

Source
HeadersSchemaOps.scala
def header[A](headerCodec: Codec[A]): Either[HeaderError, A]

Decodes the first matching header with a Header.Codec.

Decodes the first matching header with a Header.Codec.

Returns HeaderError.Missing when the header is absent and HeaderError.Malformed when parsing fails.

Attributes

Source
HeadersSchemaOps.scala
def headerAll[T](name: String)(implicit schema: Schema[T]): Either[HeaderError, Chunk[T]]

Attributes

Source
HeadersSchemaOps.scala
def headerAll[A](headerCodec: Codec[A]): Either[HeaderError, Chunk[A]]

Decodes all matching headers with a Header.Codec.

Decodes all matching headers with a Header.Codec.

Decoding preserves header order and short-circuits on the first malformed value.

Attributes

Source
HeadersSchemaOps.scala
def headerOrElse[T](name: String, default: => T)(implicit schema: Schema[T]): T

Attributes

Source
HeadersSchemaOps.scala