org.http4s.headers

Type members

Classlikes

object Accept
Companion:
class
Source:
Accept.scala
final case class Accept(values: NonEmptyList[MediaRangeAndQValue])
Companion:
object
Source:
Accept.scala
final case class Accept-Charset(values: NonEmptyList[CharsetRange])

From [https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.3 RFC-7231].

 The "Accept-Charset" header field can be sent by a user agent to
 indicate what charsets are acceptable in textual response content.
 This field allows user agents capable of understanding more

From [https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.3 RFC-7231].

Companion:
object
Source:
Accept-Charset.scala
final case class Accept-Encoding(values: NonEmptyList[ContentCoding])
final case class Accept-Language(values: NonEmptyList[LanguageTag])

Request header used to indicate which natural language would be preferred for the response to be translated into.

Request header used to indicate which natural language would be preferred for the response to be translated into.

RFC-7231 Section 5.3.5

Companion:
object
Source:
Accept-Language.scala
Companion:
class
Source:
Accept-Patch.scala
final case class Accept-Patch(values: NonEmptyList[MediaType])
Companion:
object
Source:
Accept-Patch.scala
Companion:
class
Source:
Accept-Post.scala
final case class Accept-Post(values: List[MediaType])
Companion:
object
Source:
Accept-Post.scala
final case class Accept-Ranges(rangeUnits: List[RangeUnit])
Companion:
object
Source:
Accept-Ranges.scala
final case class Access-Control-Allow-Headers(values: List[CIString])
final case class Access-Control-Allow-Methods(methods: Set[Method])

The Access-Control-Allow-Methods header.

The Access-Control-Allow-Methods header.

Companion:
object
Source:
`Access-Control-Allow-Methods`.scala
final case class Access-Control-Expose-Headers(values: List[CIString])

The Access-Control-Max-Age header.

The Access-Control-Max-Age header.

Companion:
object
Source:
`Access-Control-Max-Age`.scala
object Age
Companion:
class
Source:
Age.scala
final case class Age

Constructs an Age header.

Constructs an Age header.

The value of this field is a positive number of seconds (in decimal) with an estimate of the amount of time since the response

Value parameters:
age

age of the response

Companion:
object
Source:
Age.scala
object Allow
Companion:
class
Source:
Allow.scala
final case class Allow(methods: Set[Method])

A Response header that lists the methods that are supported by the target resource. Must be attached to responses with status 405 Not Allowed, though in practice not all servers honor this.

A Response header that lists the methods that are supported by the target resource. Must be attached to responses with status 405 Not Allowed, though in practice not all servers honor this.

RFC-7231 Section 7.4.1 Allow

Companion:
object
Source:
Allow.scala
final case class Authorization(credentials: Credentials)
Companion:
object
Source:
Authorization.scala
final case class Cache-Control(values: NonEmptyList[CacheDirective])
Companion:
object
Source:
Cache-Control.scala
object Connection
Companion:
class
Source:
Connection.scala
final case class Connection(values: NonEmptyList[CIString])
Companion:
object
Source:
Connection.scala
final case class Content-Disposition(dispositionType: String, parameters: Map[CIString, String])
final case class Content-Encoding(contentCoding: ContentCoding)
final case class Content-Language(values: NonEmptyList[LanguageTag])
final case class Content-Length(length: Long)

Constructs a Content-Length header.

Constructs a Content-Length header.

The HTTP RFCs do not specify a maximum length. We have decided that Long.MaxValue bytes ought to be good enough for anybody in order to avoid the irritations of BigInt.

Value parameters:
length

the length

Companion:
object
Source:
Content-Length.scala
final case class Content-Location(uri: Uri)
 The "Content-Location" header field references a URI that can be used
 as an identifier for a specific resource corresponding to the
 representation in this message's payload

RFC-7231 Section 3.1.4.2

Companion:
object
Source:
Content-Location.scala
final case class Content-Range(unit: RangeUnit, range: SubRange, length: Option[Long])
Companion:
object
Source:
Content-Range.scala
Companion:
class
Source:
Content-Type.scala
final case class Content-Type
 The "Content-Type" header field indicates the media type of the
 associated representation: either the representation enclosed in the
 message payload or the selected representation, as determined by the
 message semantics.

RFC-7231

Companion:
object
Source:
Content-Type.scala
object Cookie
Companion:
class
Source:
Cookie.scala
final case class Cookie(values: NonEmptyList[RequestCookie])
Companion:
object
Source:
Cookie.scala
sealed abstract class DNT(val value: String) extends Product with Serializable
Companion:
object
Source:
DNT.scala
object DNT
Companion:
class
Source:
DNT.scala
object Date
Companion:
class
Source:
Date.scala
final case class Date(date: HttpDate)
Companion:
object
Source:
Date.scala
object ETag
Companion:
class
Source:
ETag.scala
final case class ETag(tag: EntityTag)
Companion:
object
Source:
ETag.scala
object Expires
Companion:
class
Source:
Expires.scala
final case class Expires(expirationDate: HttpDate)

A Response header that gives the date/time after which the response is considered stale.

A Response header that gives the date/time after which the response is considered stale.

The HTTP RFCs indicate that Expires should be in the range of now to 1 year in the future. However, it is a usual practice to set it to the past of far in the future Thus any instant is in practice allowed

RFC-7234 Section 5.3

Value parameters:
expirationDate

the date of expiration. The RFC has a warning, that using large values can cause problems due to integer or clock overflows.

Companion:
object
Source:
Expires.scala
object Forwarded
Companion:
class
Source:
Forwarded.scala
final case class Forwarded(values: NonEmptyList[Element])
Companion:
object
Source:
Forwarded.scala
object Host
Companion:
class
Source:
Host.scala
final case class Host(host: String, port: Option[Int])

A Request header, that provides the host and port information

A Request header, that provides the host and port information

 The "Host" header field in a request provides the host and port
 information from the target URI, enabling the origin server to
 distinguish among resources while servicing requests for multiple
 host names on a single IP address.

This header was mandatory in version 1.1 of the Http protocol.

RFC-7230 Section 5.4

Companion:
object
Source:
Host.scala
final case class Idempotency-Key(key: String)

Request header defines request to be idempotent used by client retry middleware.

Request header defines request to be idempotent used by client retry middleware.

idempotency-header

Companion:
object
Source:
`Idempotency-Key`.scala
object If-Match
Companion:
class
Source:
If-Match.scala
final case class If-Match(tags: Option[NonEmptyList[EntityTag]])

Request header to make the request conditional on the current contents of the origin server at the given target resource (URI).

Request header to make the request conditional on the current contents of the origin server at the given target resource (URI).

RFC-7232 Section 3.1

Companion:
object
Source:
If-Match.scala
final case class If-Modified-Since(date: HttpDate)

{{ The "If-Modified-Since" header field makes a GET or HEAD request method conditional on the selected representation's modification date being more recent than the date provided in the field-value. }}

{{ The "If-Modified-Since" header field makes a GET or HEAD request method conditional on the selected representation's modification date being more recent than the date provided in the field-value. }}

RFC-7232

Companion:
object
Source:
If-Modified-Since.scala

From RFC-7232

The "If-None-Match" header field makes the request method conditional
on a recipient cache or origin server either not having any current
representation of the target resource, when the field-value is "*",
or having a selected representation with an entity-tag that does not
match any of those listed in the field-value.

From RFC-7232

Companion:
class
Source:
If-None-Match.scala
final case class If-None-Match(tags: Option[NonEmptyList[EntityTag]])
Companion:
object
Source:
If-None-Match.scala
sealed abstract class If-Range extends Product with Serializable
Companion:
object
Source:
If-Range.scala
object If-Range
Companion:
class
Source:
If-Range.scala
final case class If-Unmodified-Since(date: HttpDate)
object Keep-Alive
Companion:
class
Source:
Keep-Alive.scala
sealed abstract case class Keep-Alive
Companion:
object
Source:
Keep-Alive.scala
final case class Last-Event-Id(id: EventId)
Companion:
object
Source:
Last-Event-Id.scala
final case class Last-Modified(date: HttpDate)

Response header that indicates the time at which the server believes the entity was last modified.

Response header that indicates the time at which the server believes the entity was last modified.

RFC-7232

Companion:
object
Source:
Last-Modified.scala
object Link
Companion:
class
Source:
Link.scala
final case class Link(values: NonEmptyList[LinkValue])
Companion:
object
Source:
Link.scala
final case class LinkValue(uri: Uri, rel: Option[String], rev: Option[String], title: Option[String], `type`: Option[MediaRange]) extends Renderable
object Location
Companion:
class
Source:
Location.scala
final case class Location(uri: Uri)
Companion:
object
Source:
Location.scala
sealed abstract case class Max-Forwards(count: Long)

Request header, used with the TRACE and OPTION request methods, that gives an upper bound on how many times the request can be forwarded by a proxy before it is rejected.

Request header, used with the TRACE and OPTION request methods, that gives an upper bound on how many times the request can be forwarded by a proxy before it is rejected.

RFC-7231

Companion:
object
Source:
Max-Forwards.scala
Companion:
class
Source:
Max-Forwards.scala
final case class MediaRangeAndQValue(mediaRange: MediaRange, qValue: QValue) extends Renderable
Companion:
object
Source:
Accept.scala
Companion:
class
Source:
Accept.scala
sealed abstract class Origin
Companion:
object
Source:
Origin.scala
object Origin
Companion:
class
Source:
Origin.scala
final case class Proxy-Authenticate(values: NonEmptyList[Challenge])

From RFC-7235

 The "Proxy-Authenticate" header field consists of at least one
 challenge that indicates the authentication scheme(s) and parameters
 applicable to the proxy for this effective request URI...

From RFC-7235

Companion:
object
Source:
Proxy-Authenticate.scala

From RFC-7235

 The "Proxy-Authorization" header field allows the client to identify
 itself (or its user) to a proxy that requires authentication.

From RFC-7235

Companion:
class
Source:
Proxy-Authorization.scala
final case class Proxy-Authorization(credentials: Credentials)
object Range
Companion:
class
Source:
Range.scala
final case class Range(unit: RangeUnit, ranges: NonEmptyList[SubRange])
Companion:
object
Source:
Range.scala
object Referer
Companion:
class
Source:
Referer.scala
final case class Referer(uri: Uri)
Companion:
object
Source:
Referer.scala
Companion:
class
Source:
Retry-After.scala
sealed abstract case class Retry-After(retry: Either[HttpDate, Long])

Response header, used by the server to indicate to the user-agent how long it has to wait before it can try again with a follow-up request.

Response header, used by the server to indicate to the user-agent how long it has to wait before it can try again with a follow-up request.

RFC-7231 Section 7.1.3

Value parameters:
retry

Indicates the retry time, either as a date of expiration or as a number of seconds from the current time until that expiration.

Companion:
object
Source:
Retry-After.scala
final class Sec-WebSocket-Accept(hashBytes: ByteVector)
final class Sec-WebSocket-Key(hashBytes: ByteVector)
object Server
Companion:
class
Source:
Server.scala
final case class Server(product: ProductId, rest: List[ProductIdOrComment])

Server header https://datatracker.ietf.org/doc/html/rfc7231#section-7.4.2

object Set-Cookie
Companion:
class
Source:
Set-Cookie.scala
final case class Set-Cookie(cookie: ResponseCookie)
Companion:
object
Source:
Set-Cookie.scala
object SourceMap
Companion:
class
Source:
SourceMap.scala
final case class SourceMap(uri: Uri)

A Response header that links generated code to a source map, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.

A Response header that links generated code to a source map, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/SourceMap

Value parameters:
uri

A relative (to the request URL) or absolute URL pointing to a source map file.

Companion:
object
Source:
SourceMap.scala

Defined by https://datatracker.ietf.org/doc/html/rfc6797

sealed abstract case class Strict-Transport-Security(maxAge: Long, includeSubDomains: Boolean, preload: Boolean)
object Trailer
Companion:
class
Source:
Trailer.scala
final case class Trailer(headers: NonEmptyList[CIString])
object Upgrade
Companion:
class
Source:
Upgrade.scala
final case class Upgrade(values: NonEmptyList[Protocol])
Companion:
object
Source:
Upgrade.scala
object User-Agent
Companion:
class
Source:
User-Agent.scala
final case class User-Agent(product: ProductId, rest: List[ProductIdOrComment])

User-Agent header RFC-7231 Section 5.5.3

User-Agent header RFC-7231 Section 5.5.3

Companion:
object
Source:
User-Agent.scala
final case class WWW-Authenticate(values: NonEmptyList[Challenge])
object X-B3-Flags
Companion:
class
Source:
X-B3-Flags.scala
final case class X-B3-Flags(flags: Set[Flag])
Companion:
object
Source:
X-B3-Flags.scala
final case class X-B3-ParentSpanId(id: Long)
Companion:
class
Source:
X-B3-Sampled.scala
final case class X-B3-Sampled(sampled: Boolean)
Companion:
object
Source:
X-B3-Sampled.scala
Companion:
class
Source:
X-B3-SpanId.scala
final case class X-B3-SpanId(id: Long)
Companion:
object
Source:
X-B3-SpanId.scala
Companion:
class
Source:
X-B3-TraceId.scala
final case class X-B3-TraceId(idMostSigBits: Long, idLeastSigBits: Option[Long])
Companion:
object
Source:
X-B3-TraceId.scala
final case class X-Forwarded-For(values: NonEmptyList[Option[IpAddress]])
final case class X-Forwarded-Proto(scheme: Scheme) extends AnyVal

Deprecated types

@deprecated("Deprecated in favor of ProductComment", "0.22.0-M1")
Deprecated
Source:
package.scala
@deprecated("Deprecated in favor of ProductId", "0.22.0-M1")
Deprecated
Source:
package.scala
@deprecated("Deprecated in favor of ProductIdOrComment", "0.22.0-M1")
Deprecated
Source:
package.scala