A collection of HTTP Headers
Attributes
- Companion
- object
- Source
- Headers.scala
- Graph
-
- Supertypes
-
class AnyValtrait Matchableclass Any
Members list
Value members
Concrete methods
Attributes
- Source
- Headers.scala
Returns true if there is at least one header by the specified name.
Attempt to get a (potentially repeating) header from this collection of headers.
Attempt to get a (potentially repeating) header from this collection of headers.
Attributes
- Returns
-
a scala.Option possibly containing the resulting (potentially repeating) header.
- Source
- Headers.scala
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.
Attributes
- Returns
-
a scala.Option possibly containing the resulting collection cats.data.NonEmptyList of org.http4s.Header.Raw.
- Source
- Headers.scala
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.
Attributes
- Returns
-
a scala.Option possibly containing the resulting (potentially repeating) header and/or any parse errors.
- Source
- Headers.scala
Creates a string representation for a list of headers and redacts sensitive headers' values.
Creates a string representation for a list of headers and redacts sensitive headers' values.
Value parameters
- end
-
the ending string
- redactWhen
-
the function for filtering out header values of sensitive headers
- separator
-
the separator string
- start
-
the starting string
Attributes
- Returns
-
a string representation of the list of headers. The resulting string begins with the string
start
and ends with the stringend
. Inside, the string representations of all headers are separated by the stringseparator
. Sensitive headers' values are redacted with theredactWhen
function. - Source
- Headers.scala
Creates a string representation for a list of headers and redacts sensitive headers' values.
Creates a string representation for a list of headers and redacts sensitive headers' values.
Value parameters
- redactWhen
-
the function for filtering out header values of sensitive headers
- separator
-
the separator string
Attributes
- Returns
-
a string representation of the list of headers. The resulting string is constructed from the string representations of all headers separated by the string
separator
. Sensitive headers' values are redacted with theredactWhen
function. - Source
- Headers.scala
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
Attributes
- Returns
-
a new Headers containing the sum of the initial and input headers
- Source
- Headers.scala
Attributes
- Source
- Headers.scala
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
Attributes
- Source
- Headers.scala
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
-
Any
- Source
- Headers.scala
Puts a Content-Length
header, replacing any existing.
Puts a Content-Length
header, replacing any existing. Removes any existing chunked
value from the Transfer-Encoding
header. It is critical that the supplied content length accurately describe the length of the body stream.
scala> import org.http4s.headers._
scala> val chunked = Headers(
| `Transfer-Encoding`(TransferCoding.chunked),
| `Content-Type`(MediaType.text.plain))
scala> chunked.withContentLength(`Content-Length`.unsafeFromLong(1024))
res0: Headers = Headers(Content-Length: 1024, Content-Type: text/plain)
scala> val chunkedGzipped = Headers(
| `Transfer-Encoding`(TransferCoding.chunked, TransferCoding.gzip),
| `Content-Type`(MediaType.text.plain))
scala> chunkedGzipped.withContentLength(`Content-Length`.unsafeFromLong(1024))
res1: Headers = Headers(Content-Length: 1024, Transfer-Encoding: gzip, Content-Type: text/plain)
scala> val const = Headers(
| `Content-Length`(2048),
| `Content-Type`(MediaType.text.plain))
scala> const.withContentLength(`Content-Length`.unsafeFromLong(1024))
res1: Headers = Headers(Content-Length: 1024, Content-Type: text/plain)
Attributes
- Source
- Headers.scala
Concrete fields
Attributes
- Source
- Headers.scala