package http4s
- Source
- package.scala
- Alphabetic
- By Inheritance
- http4s
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
AttributeEntry[T](key: AttributeKey[T], value: T) extends Product with Serializable
A map entry where
key
is constrained to only be associated with a fixed value of typeT
. -
final
class
AttributeKey[T] extends AnyRef
A key in an AttributeMap that constrains its associated value to be of type
T
.A key in an AttributeMap that constrains its associated value to be of type
T
. The key is uniquely defined by its reference: there are no duplicate keys, even those with the same name and type. -
final
class
AttributeMap extends AnyRef
An immutable map where an AttributeKey for a fixed type
T
can only be associated with values of typeT
.An immutable map where an AttributeKey for a fixed type
T
can only be associated with values of typeT
. Because the equality of keys is based on reference, it is therefore possible for this map to contain mappings for keys with the same label and same types. - type AuthScheme = CaseInsensitiveString
- case class AuthedRequest[F[_], A](authInfo: A, req: Request[F]) extends Product with Serializable
-
type
AuthedService[T, F[_]] = Kleisli[[β$1$]OptionT[F, β$1$], AuthedRequest[F, T], Response[F]]
We need to change the order of type parameters to make partial unification trigger.
We need to change the order of type parameters to make partial unification trigger. See https://github.com/http4s/http4s/issues/1506
- final case class BasicCredentials(username: String, password: String) extends Product with Serializable
- sealed trait CacheDirective extends Product with Renderable
- type Callback[A] = (Either[Throwable, A]) ⇒ Unit
- final case class Challenge(scheme: String, realm: String, params: Map[String, String] = Map.empty) extends Renderable with Product with Serializable
- final case class Charset extends Renderable with Product with Serializable
- sealed abstract class CharsetRange extends HasQValue with Renderable
- trait CharsetRangeInstances extends AnyRef
- trait ClientTypes extends AnyRef
- class ContentCoding extends HasQValue with Ordered[ContentCoding] with Renderable
- final case class Cookie(name: String, content: String, expires: Option[HttpDate] = None, maxAge: Option[Long] = None, domain: Option[String] = None, path: Option[String] = None, secure: Boolean = false, httpOnly: Boolean = false, extension: Option[String] = None) extends Renderable with Product with Serializable
- sealed abstract class Credentials extends Renderable
-
trait
DecodeFailure extends RuntimeException with MessageFailure
Indicates a problem decoding a Message.
Indicates a problem decoding a Message. This may either be a problem with the entity headers or with the entity itself.
- type DecodeResult[F[_], A] = EitherT[F, DecodeFailure, A]
- final case class Entity[+F[_]](body: EntityBody[F], length: Option[Long] = None) extends Product with Serializable
- type EntityBody[+F[_]] = Stream[F, Byte]
-
trait
EntityDecoder[F[_], T] extends AnyRef
A type that can be used to decode a Message EntityDecoder is used to attempt to decode a Message returning the entire resulting A.
A type that can be used to decode a Message EntityDecoder is used to attempt to decode a Message returning the entire resulting A. If an error occurs it will result in a failed effect. The default decoders provided here are not streaming, but one could implement a streaming decoder by having the value of A be some kind of streaming construct.
- T
result type produced by the decoder
- Annotations
- @implicitNotFound( ... )
-
trait
EntityDecoderInstances extends AnyRef
Implementations of the EntityDecoder instances
-
trait
EntityEncoder[F[_], A] extends AnyRef
- Annotations
- @implicitNotFound( ... )
- trait EntityEncoderInstances extends EntityEncoderInstances0
- trait EntityEncoderInstances0 extends AnyRef
-
type
EventStream[F[_]] = Stream[F, ServerSentEvent]
A stream of server-sent events
- trait HasQValue extends AnyRef
-
sealed
trait
Header extends Renderable with Product
Abstract representation o the HTTP header
Abstract representation o the HTTP header
- See also
org.http4s.HeaderKey
- sealed trait HeaderKey extends AnyRef
-
final
class
Headers extends Iterable[Header] with IterableLike[Header, Headers]
A collection of HTTP Headers
- trait Http4s extends Http4sInstances with Http4sFunctions with AllSyntax
- trait Http4sFunctions extends QValueFunctions with UriFunctions
- trait Http4sInstances extends EntityDecoderInstances with HttpVersionInstances with EntityEncoderInstances with CharsetRangeInstances with QValueInstances with MethodInstances with StatusInstances
- final case class Http4sVersion(major: Int, minor: Int) extends Product with Serializable
- trait HttpCodec[A] extends Renderer[A]
-
class
HttpDate extends Renderable with Ordered[HttpDate]
An HTTP-date value represents time as an instance of Coordinated Universal Time (UTC).
An HTTP-date value represents time as an instance of Coordinated Universal Time (UTC). It expresses time at a resolution of one second. By using it over java.time.Instant in the model, we assure that if two headers render equally, their values are equal.
- See also
https://tools.ietf.org/html/rfc7231#page65
-
type
HttpService[F[_]] = Kleisli[[β$0$]OptionT[F, β$0$], Request[F], Response[F]]
A Kleisli that produces an effect to compute an OptionT[F]] from a Request[F].
A Kleisli that produces an effect to compute an OptionT[F]] from a Request[F]. In case an OptionT.none is computed the server backend should respond with a 404. An HttpService can be run on any supported http4s server backend, such as Blaze, Jetty, or Tomcat.
-
final
case class
HttpVersion extends Renderable with Ordered[HttpVersion] with Product with Serializable
An HTTP version, as seen on the start line of an HTTP request or response.
An HTTP version, as seen on the start line of an HTTP request or response.
- See also
[http://tools.ietf.org/html/rfc7230#section-2.6 RFC 7320, Section 2.6
- trait HttpVersionInstances extends AnyRef
-
final
case class
InvalidBodyException(msg: String) extends Exception with NoStackTrace with Product with Serializable
Exception dealing with invalid body
Exception dealing with invalid body
- msg
description if what makes the body invalid
-
final
case class
InvalidMessageBodyFailure(details: String, cause: Option[Throwable] = None) extends RuntimeException with MessageBodyFailure with Product with Serializable
Indicates a semantic error decoding the body of an HTTP Message.
-
final
case class
InvalidResponseException(msg: String) extends Exception with NoStackTrace with Product with Serializable
Exception dealing with invalid response
Exception dealing with invalid response
- msg
description if what makes the response invalid
- final case class LanguageTag(primaryTag: String, q: QValue = QValue.One, subTags: Seq[String] = Nil) extends Renderable with Product with Serializable
-
final
case class
MalformedMessageBodyFailure(details: String, cause: Option[Throwable] = None) extends RuntimeException with MessageBodyFailure with Product with Serializable
Indicates an syntactic error decoding the body of an HTTP Message.
- sealed class MediaRange extends Renderable
- sealed class MediaType extends MediaRange
-
final
case class
MediaTypeMismatch(messageType: MediaType, expected: Set[MediaRange]) extends UnsupportedMediaTypeFailure with Product with Serializable
Indicates that no EntityDecoder matches the MediaType of the Message being decoded
-
final
case class
MediaTypeMissing(expected: Set[MediaRange]) extends UnsupportedMediaTypeFailure with Product with Serializable
Indicates that a Message attempting to be decoded has no MediaType and no EntityDecoder was lenient enough to accept it.
-
sealed
trait
Message[F[_]] extends MessageOps[F]
Represents a HTTP Message.
Represents a HTTP Message. The interesting subclasses are Request and Response while most of the functionality is found in MessageOps and ResponseOps
- See also
-
trait
MessageBodyFailure extends RuntimeException with DecodeFailure
Indicates a problem decoding a Message body.
-
trait
MessageFailure extends RuntimeException
Indicates a failure to handle an HTTP Message.
- trait MessageOps[F[_]] extends Any
-
sealed abstract
case class
Method extends Renderable with Semantics with Product with Serializable
An HTTP method.
An HTTP method.
- See also
[http://tools.ietf.org/html/rfc7231#section-4 RFC7321, Section 4]
[http://www.iana.org/assignments/http-methods/http-methods.xhtml IANA HTTP Method Registry]
- trait MethodInstances extends AnyRef
-
final
case class
ParseFailure(sanitized: String, details: String) extends RuntimeException with MessageFailure with NoStackTrace with Product with Serializable
Indicates an error parsing an HTTP Message.
Indicates an error parsing an HTTP Message.
- sanitized
May safely be displayed to a client to describe an error condition. Should not echo any part of a Request.
- details
Contains any relevant details omitted from the sanitized version of the error. This may freely echo a Request.
- type ParseResult[+A] = Either[ParseFailure, A]
-
final
class
QValue extends AnyVal with Ordered[QValue]
A Quality Value.
A Quality Value. Represented as thousandths for an exact representation rounded to three decimal places.
- See also
- trait QValueFunctions extends AnyRef
- trait QValueInstances extends AnyRef
-
final
class
Query extends IndexedSeq[KeyValue] with IndexedSeqOptimized[KeyValue, Query] with QueryOps with Renderable
Collection representation of a query string
Collection representation of a query string
It is a indexed sequence of key and maybe a value pairs which maps precisely to a query string, modulo the identity of separators.
When rendered, the resulting
String
will have the pairs separated by '&' while the key is separated from the value with '=' - trait QueryOps extends AnyRef
-
trait
QueryParam[T] extends AnyRef
type class defining the key of a query parameter Usually used in conjunction with QueryParamEncoder and QueryParamDecoder
-
trait
QueryParamDecoder[T] extends AnyRef
Type class defining how to decode a QueryParameterValue into a
T
Type class defining how to decode a QueryParameterValue into a
T
- See also
QueryParamCodecLaws
-
trait
QueryParamEncoder[T] extends AnyRef
Type class defining how to encode a
T
as a QueryParameterValuesType class defining how to encode a
T
as a QueryParameterValues- See also
QueryParamCodecLaws
- trait QueryParamKeyLike[T] extends AnyRef
- final case class QueryParameterKey(value: String) extends AnyVal with Product with Serializable
- final case class QueryParameterValue(value: String) extends AnyVal with Product with Serializable
- final case class RangeUnit(value: String) extends Renderable with Product with Serializable
-
sealed abstract
case class
Request[F[_]] extends Message[F] with RequestOps[F] with Product with Serializable
Representation of an incoming HTTP message
Representation of an incoming HTTP message
A Request encapsulates the entirety of the incoming HTTP request including the status line, headers, and a possible request body.
- class RequestCookieJar extends Iterable[Cookie] with IterableLike[Cookie, RequestCookieJar]
- trait RequestOps[F[_]] extends MessageOps[F]
-
final
case class
Response[F[_]](status: Status = Status.Ok, httpVersion: HttpVersion = HttpVersion.`HTTP/1.1`, headers: Headers = Headers.empty, body: EntityBody[F] = EmptyBody, attributes: AttributeMap = AttributeMap.empty) extends Message[F] with ResponseOps[F] with Product with Serializable
Representation of the HTTP response to send back to the client
Representation of the HTTP response to send back to the client
- status
Status code and message
- headers
Headers containing all response headers
- body
EntityBody[F] representing the possible body of the response
- attributes
AttributeMap containing additional parameters which may be used by the http4s backend for additional processing such as java.io.File object
- trait ResponseOps[F[_]] extends MessageOps[F]
- case class ServerSentEvent(data: String, eventType: Option[String] = None, id: Option[EventId] = None, retry: Option[Long] = None) extends Renderable with Product with Serializable
-
sealed abstract
case class
Status extends Ordered[Status] with Renderable with Product with Serializable
Representation of the HTTP response code and reason
Representation of the HTTP response code and reason
Note: the reason is not important to the protocol and is not considered in equality checks.
- See also
[http://tools.ietf.org/html/rfc7231#section-6 RFC7231, Section 6]
[http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml IANA Status Code Registry]
- trait StatusInstances extends AnyRef
- class TransferCoding extends Ordered[TransferCoding] with Renderable
- sealed abstract class UnsupportedMediaTypeFailure extends RuntimeException with DecodeFailure with NoStackTrace
-
final
case class
Uri(scheme: Option[Scheme] = None, authority: Option[Authority] = None, path: Path = "", query: Query = Query.empty, fragment: Option[Fragment] = None) extends QueryOps with Renderable with Product with Serializable
Representation of the Request URI
Representation of the Request URI
- scheme
optional Uri Scheme. eg, http, https
- authority
optional Uri Authority. eg, localhost:8080, www.foo.bar
- path
url-encoded string representation of the path component of the Uri.
- query
optional Query. url-encoded.
- fragment
optional Uri Fragment. url-encoded.
- trait UriFunctions extends AnyRef
-
final
case class
UriTemplate(scheme: Option[Scheme] = None, authority: Option[Authority] = None, path: Path = Nil, query: UriTemplate.Query = Nil, fragment: Fragment = Nil) extends Product with Serializable
Simple representation of a URI Template that can be rendered as RFC6570 conform string.
Simple representation of a URI Template that can be rendered as RFC6570 conform string.
This model reflects only a subset of RFC6570.
Level 1 and Level 2 are completely modeled and Level 3 features are limited to:
- Path segments, slash-prefixed
- Form-style query, ampersand-separated
- Fragment expansion
- final class UrlForm extends AnyVal
-
type
Http4sSyntax = AllSyntax
- Annotations
- @deprecated
- Deprecated
(Since version 0.16) Moved to org.http4s.syntax.AllSyntax
-
type
Service[F[_], A, B] = Kleisli[F, A, B]
A Service wraps a function of request type
A
to an effect that runs to response typeB
.A Service wraps a function of request type
A
to an effect that runs to response typeB
. By wrapping the Service, we can compose them using Kleisli operations.- Annotations
- @deprecated
- Deprecated
(Since version 0.18) Deprecated in favor of just using Kleisli
Value Members
- val ApiVersion: Http4sVersion
- val DefaultCharset: Charset
- val EmptyBody: EntityBody[Nothing]
- object AttributeKey
- object AttributeMap
- object AuthScheme
- object AuthedRequest extends Serializable
- object AuthedService
- object BasicCredentials extends Serializable
-
object
BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
-
object
CacheDirective
A registry of cache-directives, as listed in http://www.iana.org/assignments/http-cache-directives/http-cache-directives.xhtml
- object Charset extends Serializable
- object CharsetRange extends CharsetRangeInstances
- object ContentCoding
- object Credentials
- object DecodeResult
- object Entity extends Serializable
-
object
EntityDecoder extends EntityDecoderInstances
EntityDecoder is used to attempt to decode an EntityBody This companion object provides a way to create
new EntityDecoder
s along with some commonly used instances which can be resolved implicitly. - object EntityEncoder extends EntityEncoderInstances
- object Header
- object HeaderKey
- object Headers
- object Http4s extends Http4s
- object Http4sFunctions extends Http4sFunctions
- object Http4sInstances extends Http4sInstances
- object HttpCodec
- object HttpDate
- object HttpService extends Serializable
- object HttpVersion extends HttpVersionInstances with Serializable
- object LanguageTag extends Serializable
- object MediaRange
- object MediaType extends Registry
- object Message
- object Method extends MethodInstances with Serializable
- object ParseFailure extends Serializable
- object ParseResult
- object QValue extends QValueInstances with QValueFunctions
- object Query
- object QueryParam
- object QueryParamDecoder
- object QueryParamEncoder
- object QueryParamKeyLike
- object RangeUnit extends Serializable
- object Request extends Serializable
- object RequestCookieJar
- object Response extends Serializable
- object ServerSentEvent extends Serializable
- object StaticFile
- object Status extends Serializable
- object TransferCoding
- object Uri extends UriFunctions with Serializable
- object UriTemplate extends Serializable
- object UrlForm
- object implicits extends AllSyntax