Headers

final class Headers(val headers: List[Raw]) extends AnyVal

A collection of HTTP Headers

Companion:
object
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def ++(those: Headers): Headers
def add[H : ([H] =>> Header[H, Recurring])](h: H): Headers
def contains[A](implicit ev: Header[A, _]): Boolean

Returns true if there is at least one header by the specified name.

Returns true if there is at least one header by the specified name.

def foreach(f: Raw => Unit): Unit
def get[A](implicit ev: Select[A]): Option[F[A]]

Attempt to get a (potentially repeating) header from this collection of headers.

Attempt to get a (potentially repeating) header from this collection of headers.

Returns:

a scala.Option possibly containing the resulting (potentially repeating) header.

def get(key: CIString): Option[NonEmptyList[Raw]]

Attempt to get headers by key from this collection of headers.

Attempt to get headers by key from this collection of headers.

Value parameters:
key

name of the headers to find.

Returns:

a scala.Option possibly containing the resulting collection cats.data.NonEmptyList of org.http4s.Header.Raw.

def getWithWarnings[A](implicit ev: Select[A]): Option[Ior[NonEmptyList[ParseFailure], F[A]]]

Attempt to get a (potentially repeating) header and/or any parse errors from this collection of headers.

Attempt to get a (potentially repeating) header and/or any parse errors from this collection of headers.

Returns:

a scala.Option possibly containing the resulting (potentially repeating) header and/or any parse errors.

def put(in: ToRaw*): Headers

Make a new collection adding the specified headers, replacing existing Single headers.

Make a new collection adding the specified headers, replacing existing Single headers.

Value parameters:
in

multiple heteregenous headers Header to append to the new collection, see Header.ToRaw

Returns:

a new Headers containing the sum of the initial and input headers

def redactSensitive(redactWhen: CIString => Boolean): Headers

Removes the Content-Length, Content-Range, Trailer, and Transfer-Encoding headers.

Removes the Content-Length, Content-Range, Trailer, and Transfer-Encoding headers.

https://datatracker.ietf.org/doc/html/rfc7231#section-3.3

override def toString: String
Definition Classes
Any
def transform(f: List[Raw] => List[Raw]): Headers

Concrete fields

val headers: List[Raw]