org.http4s.headers

Type members

Classlikes

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

From [http//tools.ietf.org/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 [http//tools.ietf.org/html/rfc7231#section-5.3.3 RFC-7231].

Companion
object
Companion
class
final case class Accept-Encoding(values: NonEmptyList[ContentCoding])
Companion
object
Companion
class
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
object Accept-Patch
Companion
class
final case class Accept-Patch(values: NonEmptyList[MediaType])
Companion
object
Companion
class
final case class Accept-Ranges
Companion
object
Companion
object
final case class Access-Control-Allow-Headers(values: List[CIString])
Companion
object
final case class Access-Control-Expose-Headers(values: List[CIString])
Companion
object
final case class Access-Control-Request-Method(method: Method)
Companion
object
object Age
Companion
class
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 Params
age

age of the response

Companion
object
object Allow
Companion
class
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
Companion
class
final case class Authorization(credentials: Credentials)
Companion
object
Companion
class
final case class Cache-Control(values: NonEmptyList[CacheDirective])
Companion
object
object Connection
Companion
class
final case class Connection(values: NonEmptyList[CIString])
Companion
object
Companion
class
final case class Content-Disposition(dispositionType: String, parameters: Map[CIString, String])
Companion
object
Companion
class
final case class Content-Encoding(contentCoding: ContentCoding)
Companion
object
Companion
class
final case class Content-Language(values: NonEmptyList[LanguageTag])
Companion
object
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 Params
length

the length

Companion
object
Companion
class
Companion
class
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
Companion
class
final case class Content-Range(unit: RangeUnit, range: SubRange, length: Option[Long])
Companion
object
object Content-Type
Companion
class
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
object Cookie
Companion
class
final case class Cookie(values: NonEmptyList[RequestCookie])
Companion
object
object Date
Companion
class
final case class Date(date: HttpDate)
Companion
object
object ETag
Companion
class
final case class ETag(tag: EntityTag)
Companion
object
object Expires
Companion
class
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 Params
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
object Forwarded extends ForwardedRenderers
Companion
class
final case class Forwarded(values: NonEmptyList[Element])
Companion
object
object Host
Companion
class
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
Companion
class
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
object If-Match
Companion
class
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
Companion
class
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

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
final case class If-None-Match(tags: Option[NonEmptyList[EntityTag]])
Companion
object
Companion
class
final case class If-Unmodified-Since(date: HttpDate)
Companion
object
final case class Last-Event-Id(id: EventId)
Companion
object
Companion
class
Companion
class
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
object Link
Companion
class
final case class Link(values: NonEmptyList[LinkValue])
Companion
object
final case class LinkValue(uri: Uri, rel: Option[String], rev: Option[String], title: Option[String], `type`: Option[MediaRange]) extends Renderable
object Location
Companion
class
final case class Location(uri: Uri)
Companion
object
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
object Max-Forwards
Companion
class
final case class MediaRangeAndQValue(mediaRange: MediaRange, qValue: QValue) extends Renderable
Companion
object
Companion
class
sealed abstract class Origin
Companion
object
object Origin
Companion
class
Companion
class
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

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
final case class Proxy-Authorization(credentials: Credentials)
Companion
object
object Range
Companion
class
final case class Range(unit: RangeUnit, ranges: NonEmptyList[SubRange])
Companion
object
object Referer
Companion
class
final case class Referer(uri: Uri)
Companion
object
object Retry-After
Companion
class
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 Params
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
final class Sec-WebSocket-Accept(hashBytes: ByteVector)
Companion
object
Companion
class
final class Sec-WebSocket-Key(hashBytes: ByteVector)
Companion
object
Companion
class
final case class Sec-WebSocket-Version
Companion
object
object Server
Companion
class
final case class Server(product: ProductId, rest: List[ProductIdOrComment])

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

object Set-Cookie
Companion
class
final case class Set-Cookie(cookie: ResponseCookie)
Companion
object

Defined by http://tools.ietf.org/html/rfc6797

sealed abstract case class Strict-Transport-Security(maxAge: Long, includeSubDomains: Boolean, preload: Boolean)
Companion
object
Companion
class
final case class Transfer-Encoding(values: NonEmptyList[TransferCoding])
Companion
object
object Upgrade
Companion
class
final case class Upgrade(values: NonEmptyList[Protocol])
Companion
object
object User-Agent
Companion
class
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
Companion
class
final case class WWW-Authenticate(values: NonEmptyList[Challenge])
Companion
object
object X-B3-Flags
Companion
class
final case class X-B3-Flags(flags: Set[Flag])
Companion
object
Companion
class
final case class X-B3-ParentSpanId(id: Long)
Companion
object
object X-B3-Sampled
Companion
class
final case class X-B3-Sampled(sampled: Boolean)
Companion
object
object X-B3-SpanId
Companion
class
final case class X-B3-SpanId(id: Long)
Companion
object
object X-B3-TraceId
Companion
class
final case class X-B3-TraceId(idMostSigBits: Long, idLeastSigBits: Option[Long])
Companion
object
Companion
class
final case class X-Forwarded-For(values: NonEmptyList[Option[IpAddress]])
Companion
object

Deprecated types

@deprecated("Deprecated in favor of ProductComment", "0.22.0-M1")
Deprecated
@deprecated("Deprecated in favor of ProductId", "0.22.0-M1")
Deprecated
@deprecated("Deprecated in favor of ProductIdOrComment", "0.22.0-M1")
Deprecated