Headers

zio.http.Headers
See theHeaders companion object
sealed trait Headers extends Iterable[Header]

Represents an immutable collection of headers. It extends HeaderExtensions and has a ton of powerful operators that can be used to add, remove and modify headers.

NOTE: Generic operators that are not specific to Headers should not be defined here. A better place would be one of the traits extended by HeaderExtension.

Attributes

Companion
object
Graph
Supertypes
Self type

Members list

Value members

Abstract methods

def contains(key: CharSequence): Boolean
override def iterator: Iterator[Header]

Attributes

Definition Classes

Concrete methods

final def ++(other: Headers): Headers
final def combine(other: Headers): Headers
final def combineIf(cond: Boolean)(other: Headers): Headers
final def get(key: CharSequence): Option[String]
final def get(headerType: HeaderType): Option[headerType.HeaderValue]
final def getAll(headerType: HeaderType): Chunk[headerType.HeaderValue]
final override def headers: Headers

Returns the headers

Returns the headers

Attributes

Definition Classes
final def modify(f: Header => Header): Headers
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Iterable -> Any
final override def updateHeaders(update: Headers => Headers)(implicit trace: Trace): Headers

Updates the current Headers with new one, using the provided update function passed.

Updates the current Headers with new one, using the provided update function passed.

Attributes

Definition Classes
final def when(cond: Boolean): Headers

Inherited methods

final def ++[B >: Header](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
final def addHeader[T](value: T)(implicit schema: Schema[T]): Headers

Adds headers based on the given value. The type of the value must have a schema and be a case class and all fields will be added as headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. The header names are the field names.

Adds headers based on the given value. The type of the value must have a schema and be a case class and all fields will be added as headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. The header names are the field names.

Attributes

Inherited from:
HeaderModifier
final def addHeader[T](name: String, value: T)(implicit schema: Schema[T]): Headers

Adds a header / headers with the specified name and based on the given value. The value type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Adds a header / headers with the specified name and based on the given value. The value type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
HeaderModifier
protected def addHeader(name: CharSequence, value: CharSequence): Headers

Attributes

Inherited from:
HeaderModifier
final def addHeader(header: Header): Headers

Attributes

Inherited from:
HeaderModifier
final def addHeaders(headers: Iterable[(CharSequence, CharSequence)]): Headers

Attributes

Inherited from:
HeaderModifier
final def addHeaders(headers: Headers): Headers

Attributes

Inherited from:
HeaderModifier
final def addString(b: StringBuilder): b.type

Attributes

Inherited from:
IterableOnceOps
final def addString(b: StringBuilder, sep: String): b.type

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps
def copyToArray[B >: Header](xs: Array[B], start: Int, len: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: Header](xs: Array[B], start: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: Header](xs: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def count(p: Header => Boolean): Int

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
override def empty: Iterable[Header]

Attributes

Definition Classes
Inherited from:
IterableFactoryDefaults

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps
def flatten[B](implicit asIterable: Header => IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def fold[A1 >: Header](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, Header) => B): B

Attributes

Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (Header, B) => B): B

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def foreach[U](f: Header => U): Unit

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableFactoryDefaults
def groupBy[K](f: Header => K): Map[K, Iterable[Header]]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: Header => K)(f: Header => B): Map[K, Iterable[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: Header => K)(f: Header => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
final def hasContentType(mediaType: MediaType): Boolean

Attributes

Inherited from:
HeaderChecks
final def hasContentType(value: CharSequence): Boolean

Attributes

Inherited from:
HeaderChecks

Attributes

Inherited from:
HeaderChecks

Attributes

Inherited from:
HeaderChecks
final def hasHeader(header: Header): Boolean

Attributes

Inherited from:
HeaderChecks
final def hasHeader(headerType: HeaderType): Boolean

Attributes

Inherited from:
HeaderChecks
final def hasHeader(name: CharSequence): Boolean

Attributes

Inherited from:
HeaderChecks

Attributes

Inherited from:
HeaderChecks

Attributes

Inherited from:
HeaderChecks

Attributes

Inherited from:
HeaderChecks

Attributes

Inherited from:
HeaderChecks
def head: Header

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
final def header[T](implicit schema: Schema[T]): Either[HeaderError, T]

Retrieves headers as a value of the specified type. The type must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Retrieves headers as a value of the specified type. The type must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Attributes

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

Retrieves the header with the specified name as a value of the specified type. The type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Retrieves the header with the specified name as a value of the specified type. The type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
HeaderGetters
final def header(headerType: HeaderType): Option[headerType.HeaderValue]

Gets a header or returns None if the header was not present or it could not be parsed

Gets a header or returns None if the header was not present or it could not be parsed

Attributes

Inherited from:
HeaderGetters
final def headerOrElse[T](default: => T)(implicit schema: Schema[T]): T

Retrieves headers as a value of the specified type T, or returns a default value if the headers are not present or could not be parsed. The type T must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Retrieves headers as a value of the specified type T, or returns a default value if the headers are not present or could not be parsed. The type T must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Attributes

Inherited from:
HeaderGetters
final def headerOrElse[T](name: String, default: => T)(implicit schema: Schema[T]): T

Retrieves the header with the specified name as a value of the specified type T, or returns a default value if the header is not present or could not be parsed. The type T must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Retrieves the header with the specified name as a value of the specified type T, or returns a default value if the header is not present or could not be parsed. The type T must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
HeaderGetters
final def headerOrFail(headerType: HeaderType): Option[Either[String, headerType.HeaderValue]]

Gets a header. If the header is not present, returns None. If the header could not be parsed it returns the parsing error

Gets a header. If the header is not present, returns None. If the header could not be parsed it returns the parsing error

Attributes

Inherited from:
HeaderGetters
final def headerZIO[T](name: String)(implicit schema: Schema[T]): IO[HeaderError, T]

Attributes

Inherited from:
HeaderGetters
final def headers(headerType: HeaderType): Chunk[headerType.HeaderValue]

Attributes

Inherited from:
HeaderGetters

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOnceOps
override def isTraversableAgain: Boolean

Attributes

Definition Classes
Inherited from:
IterableOps

Attributes

Inherited from:
Iterable
def knownSize: Int

Attributes

Inherited from:
IterableOnce
def last: Header

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[Header, B, Iterable.this.type]

Attributes

Inherited from:
Iterable
def map[B](f: Header => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def max[B >: Header](implicit ord: Ordering[B]): Header

Attributes

Inherited from:
IterableOnceOps
def maxBy[B](f: Header => B)(implicit ord: Ordering[B]): Header

Attributes

Inherited from:
IterableOnceOps
def maxByOption[B](f: Header => B)(implicit ord: Ordering[B]): Option[Header]

Attributes

Inherited from:
IterableOnceOps
def maxOption[B >: Header](implicit ord: Ordering[B]): Option[Header]

Attributes

Inherited from:
IterableOnceOps
def min[B >: Header](implicit ord: Ordering[B]): Header

Attributes

Inherited from:
IterableOnceOps
def minBy[B](f: Header => B)(implicit ord: Ordering[B]): Header

Attributes

Inherited from:
IterableOnceOps
def minByOption[B](f: Header => B)(implicit ord: Ordering[B]): Option[Header]

Attributes

Inherited from:
IterableOnceOps
def minOption[B >: Header](implicit ord: Ordering[B]): Option[Header]

Attributes

Inherited from:
IterableOnceOps
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableFactoryDefaults

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps
def partitionMap[A1, A2](f: Header => Either[A1, A2]): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def product[B >: Header](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
final def rawHeader(headerType: HeaderType): Option[String]

Gets the raw unparsed header value

Gets the raw unparsed header value

Attributes

Inherited from:
HeaderGetters
final def rawHeader(name: CharSequence): Option[String]

Gets the raw unparsed header value

Gets the raw unparsed header value

Attributes

Inherited from:
HeaderGetters
def rawHeaders(name: CharSequence): Chunk[String]

Attributes

Inherited from:
HeaderGetters
def reduce[B >: Header](op: (B, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeft[B >: Header](op: (B, Header) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeftOption[B >: Header](op: (B, Header) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceOption[B >: Header](op: (B, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceRight[B >: Header](op: (Header, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: Header](op: (Header, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
final def removeHeader(name: String): Headers

Attributes

Inherited from:
HeaderModifier
final def removeHeader(headerType: HeaderType): Headers

Attributes

Inherited from:
HeaderModifier
final def removeHeaders(headers: Set[String]): Headers

Attributes

Inherited from:
HeaderModifier
protected def reversed: Iterable[Header]

Attributes

Inherited from:
IterableOnceOps
def scan[B >: Header](z: B)(op: (B, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanLeft[B](z: B)(op: (B, Header) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanRight[B](z: B)(op: (Header, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
final def setHeaders(headers: Headers): Headers

Attributes

Inherited from:
HeaderModifier
def size: Int

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
override def splitAt(n: Int): (Iterable[Header], Iterable[Header])

Attributes

Definition Classes
Inherited from:
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[Header, S]): S

Attributes

Inherited from:
IterableOnce
def sum[B >: Header](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
override def tapEach[U](f: Header => U): Iterable[Header]

Attributes

Definition Classes
Inherited from:
IterableOps
def to[C1](factory: Factory[Header, C1]): C1

Attributes

Inherited from:
IterableOnceOps
def toArray[B >: Header : ClassTag]: Array[B]

Attributes

Inherited from:
IterableOnceOps
final def toBuffer[B >: Header]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: Header <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
def toSeq: Seq[Header]

Attributes

Inherited from:
IterableOnceOps
def toSet[B >: Header]: Set[B]

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: Header => Iterable[B]): Iterable[Iterable[B]]

Attributes

Inherited from:
IterableOps
def unzip[A1, A2](implicit asPair: Header => (A1, A2)): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: Header => (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

Attributes

Inherited from:
IterableOps
def view: View[Header]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def zipAll[A1 >: Header, B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Deprecated and Inherited methods

Attributes

Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from:
IterableOps
final def /:[B](z: B)(op: (B, Header) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (Header, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, Header) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`.
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: Header](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def repr: Iterable[Header]

Attributes

Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
final def toIterator: Iterator[Header]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[Header]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps