Packages

p

org

http4s

package http4s

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. http4s
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type AuthScheme = CIString
  2. type AuthedRequest[F[_], T] = ContextRequest[F, T]
  3. type AuthedRoutes[T, F[_]] = Kleisli[[β$1$]OptionT[F, β$1$], AuthedRequest[F, T], Response[F]]

    The type parameters need to be in this order to make partial unification trigger.

    The type parameters need to be in this order to make partial unification trigger. See https://github.com/http4s/http4s/issues/1506

  4. final case class BasicCredentials(username: String, password: String, charset: java.nio.charset.Charset = StandardCharsets.UTF_8) extends Product with Serializable
  5. sealed trait CacheDirective extends Product with Renderable
  6. type Callback[A] = (Either[Throwable, A]) ⇒ Unit
  7. final case class Challenge(scheme: String, realm: String, params: Map[String, String] = Map.empty) extends Renderable with Product with Serializable
  8. final case class Charset extends Renderable with Product with Serializable
  9. sealed abstract class CharsetRange extends HasQValue with Renderable
  10. trait ClientTypes extends AnyRef
  11. class ContentCoding extends HasQValue with Ordered[ContentCoding] with Renderable
  12. final case class ContextRequest[F[_], A](context: A, req: Request[F]) extends Product with Serializable
  13. final case class ContextResponse[F[_], A](context: A, response: Response[F]) extends Product with Serializable
  14. type ContextRoutes[T, F[_]] = Kleisli[[β$2$]OptionT[F, β$2$], ContextRequest[F, T], Response[F]]
  15. sealed abstract class Credentials extends Renderable
  16. 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.

  17. type DecodeResult[F[_], A] = EitherT[F, DecodeFailure, A]
  18. final case class Entity[+F[_]](body: EntityBody[F], length: Option[Long] = None) extends Product with Serializable
  19. type EntityBody[+F[_]] = Stream[F, Byte]
  20. 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( ... )
  21. trait EntityEncoder[F[_], A] extends AnyRef
    Annotations
    @implicitNotFound( ... )
  22. final case class EntityTag(tag: String, weakness: Weakness = Strong) extends Product with Serializable
  23. type EventStream[F[_]] = Stream[F, ServerSentEvent]

    A stream of server-sent events

  24. sealed trait FormDataDecoder[A] extends AnyRef

    A decoder ware that uses QueryParamDecoder to decode values in org.http4s.UrlForm

    A decoder ware that uses QueryParamDecoder to decode values in org.http4s.UrlForm

    Examples:
    1. scala> import cats.syntax.all._
      scala> import cats.data._
      scala> import org.http4s.FormDataDecoder._
      scala> import org.http4s.ParseFailure
      scala> case class Foo(a: String, b: Boolean)
      scala> case class Bar(fs: List[Foo], f: Foo, d: Boolean)
      scala>
      scala> implicit val fooMapper: FormDataDecoder[Foo] = (
           |   field[String]("a"),
           |   field[Boolean]("b")
           | ).mapN(Foo.apply)
      scala>
      scala> val barMapper = (
           |   list[Foo]("fs"),
           |   nested[Foo]("f"),
           |   field[Boolean]("d")
           | ).mapN(Bar.apply)
      scala>
      scala> barMapper(
           |   Map(
           |    "fs[].a" -> Chain("a1", "a2"),
           |    "fs[].b" -> Chain("true", "false"),
           |    "f.a" -> Chain("fa"),
           |    "f.b" -> Chain("false"),
           |    "d" -> Chain("true"))
           | )
      res1: ValidatedNel[ParseFailure, Bar] = Valid(Bar(List(Foo(a1,true), Foo(a2,false)),Foo(fa,false),true))

      The companion object provides a EntityDecoder from HTML form parameters.

    2. ,
    3. import org.http4s.FormDataDecoder.formEntityDecoder
      HttpRoutes
       .of[F] {
         case req @ POST -> Root =>
           req.as[MyEntity].flatMap { entity =>
             Ok()
           }
       }

      For more examples, check the tests https://github.com/http4s/http4s/blob/main/tests/src/test/scala/org/http4s/FormDataDecoderSpec.scala

  25. trait HasQValue extends AnyRef
  26. trait Header[A, T <: Type] extends AnyRef

    Typeclass representing an HTTP header, which all the http4s default headers satisfy.

    Typeclass representing an HTTP header, which all the http4s default headers satisfy. You can add modelled headers by providing an implicit instance of Header[YourModelledHeader]

  27. final class Headers extends AnyVal

    A collection of HTTP Headers

  28. type Http[F[_], G[_]] = Kleisli[F, Request[G], Response[G]]

    A kleisli with a Request input and a Response output.

    A kleisli with a Request input and a Response output. This type is useful for writing middleware that are polymorphic over the return type F.

  29. final case class Http4sVersion(major: Int, minor: Int) extends Product with Serializable
  30. type HttpApp[F[_]] = Kleisli[F, Request[F], Response[F]]

    A kleisli with a Request input and a Response output, such that the response effect is the same as the request and response bodies'.

    A kleisli with a Request input and a Response output, such that the response effect is the same as the request and response bodies'. An HTTP app is total on its inputs. An HTTP app may be run by a server, and a client can be converted to or from an HTTP app.

  31. trait HttpCodec[A] extends Renderer[A]
  32. 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

    RFC 7231, Section 7.1.1, Origination Date

  33. type HttpRoutes[F[_]] = Kleisli[[β$0$]OptionT[F, β$0$], Request[F], Response[F]]

    A kleisli with a Request input and a Response output, such that the response effect is an optional inside the effect of the request and response bodies.

    A kleisli with a Request input and a Response output, such that the response effect is an optional inside the effect of the request and response bodies. HTTP routes can conveniently be constructed from a partial function and combined as a SemigroupK.

  34. 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

    RFC 7320, Section 2.6, Protocol Versioning

  35. 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

  36. 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.

  37. 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

  38. final case class LanguageTag(primaryTag: String, q: QValue = QValue.One, subTags: List[String] = Nil) extends Renderable with Product with Serializable
  39. 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.

  40. trait Media[F[_]] extends AnyRef
  41. sealed class MediaRange extends AnyRef
  42. sealed class MediaType extends MediaRange
  43. 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

  44. 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.

  45. trait MediaTypePlaform extends AnyRef
  46. sealed trait Message[F[_]] extends Media[F]

    Represents a HTTP Message.

    Represents a HTTP Message. The interesting subclasses are Request and Response.

  47. trait MessageBodyFailure extends RuntimeException with DecodeFailure

    Indicates a problem decoding a Message body.

  48. trait MessageFailure extends RuntimeException

    Indicates a failure to handle an HTTP Message.

  49. final class Method extends Renderable with Serializable

    An HTTP method.

  50. 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.

  51. type ParseResult[+A] = Either[ParseFailure, A]
  52. final case class ProductComment(value: String) extends ProductIdOrComment with Product with Serializable
  53. final case class ProductId(value: String, version: Option[String] = None) extends ProductIdOrComment with Product with Serializable
  54. sealed trait ProductIdOrComment extends Renderable
  55. 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

    RFC 2616, Section 3.9, Quality Values

  56. trait QValuePlatform extends AnyRef
  57. final class Query extends 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 '='

  58. trait QueryOps extends AnyRef
  59. trait QueryParam[T] extends QueryParamKeyLike[T]

    type class defining the key of a query parameter Usually used in conjunction with QueryParamEncoder and QueryParamDecoder

    type class defining the key of a query parameter Usually used in conjunction with QueryParamEncoder and QueryParamDecoder

    Any QueryParam instance is also a valid QueryParamKeyLike instance where the same key is used for all values.

  60. trait QueryParamCodec[T] extends QueryParamEncoder[T] with QueryParamDecoder[T]
  61. 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

  62. trait QueryParamEncoder[T] extends AnyRef

    Type class defining how to encode a T as a QueryParameterValues

    Type class defining how to encode a T as a QueryParameterValues

    See also

    QueryParamCodecLaws

  63. trait QueryParamKeyLike[T] extends AnyRef
  64. final case class QueryParameterKey(value: String) extends AnyVal with Product with Serializable
  65. final case class QueryParameterValue(value: String) extends AnyVal with Product with Serializable
  66. final case class RangeUnit(value: String) extends Renderable with Product with Serializable
  67. final class Request[F[_]] extends Message[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.

  68. final case class RequestCookie(name: String, content: String) extends Renderable with Product with Serializable
  69. final class Response[F[_]] extends Message[F] with Product with Serializable

    Representation of the HTTP response to send back to the client

  70. final case class ResponseCookie(name: String, content: String, expires: Option[HttpDate] = None, maxAge: Option[Long] = None, domain: Option[String] = None, path: Option[String] = None, sameSite: Option[SameSite] = None, secure: Boolean = false, httpOnly: Boolean = false, extension: Option[String] = None) extends Renderable with Product with Serializable

    extension

    The extension attributes of the cookie. If there is more than one, they are joined by semi-colon, which must not appear in an attribute value.

  71. sealed trait SameSite extends Renderable

    RFC6265 SameSite cookie attribute values.

  72. final case class ServerSentEvent(data: Option[String] = None, eventType: Option[String] = None, id: Option[EventId] = None, retry: Option[FiniteDuration] = None, comment: Option[String] = None) extends Renderable with Product with Serializable
  73. final case class ServerSoftware(product: String, productVersion: Option[String] = None, comment: Option[String] = None) extends Product with Serializable
  74. 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

    RFC 7231, Section 6, Response Status Codes

    IANA Status Code Registry

  75. class TransferCoding extends Ordered[TransferCoding] with Renderable
  76. sealed abstract class UnsupportedMediaTypeFailure extends RuntimeException with DecodeFailure with NoStackTrace

    Indicates that a Message came with no supported MediaType.

  77. final case class Uri(scheme: Option[Scheme] = None, authority: Option[Authority] = None, path: Path = Uri.Path.empty, 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.

  78. trait UriPlatform extends AnyRef
  79. 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
  80. final class UrlForm extends AnyVal
  81. trait Http4s extends Http4sInstances with Http4sFunctions with AllSyntax
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Use org.http4s.implicits._ instead

  82. trait Http4sFunctions extends AnyRef
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Use org.http4s.qvalue._ or org.http4s.Uri._ instead

  83. trait Http4sInstances extends AnyRef
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Import from or use EntityDecoder/EntityEncoder directly instead

  84. type Http4sSyntax = AllSyntax
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Moved to org.http4s.syntax.AllSyntax

  85. final class RequestCookieJar extends AnyVal
    Annotations
    @deprecated
    Deprecated

    (Since version 0.21.20) Use the CookieJar middleware instead

Value Members

  1. val ApiVersion: Http4sVersion
  2. val DefaultCharset: Charset
  3. val EmptyBody: EntityBody[Nothing]
  4. object AuthScheme
  5. object AuthedRequest
  6. object AuthedRoutes
  7. object BasicCredentials extends Serializable
  8. object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  9. object CacheDirective

    A registry of cache-directives, as listed in http://www.iana.org/assignments/http-cache-directives/http-cache-directives.xhtml

  10. object Charset extends Serializable
  11. object CharsetRange
  12. object ContentCoding
  13. object ContextRequest extends Serializable
  14. object ContextResponse extends Serializable
  15. object ContextRoutes
  16. object Credentials
  17. object DecodeFailure extends Serializable
  18. object DecodeResult
  19. object Entity extends Serializable
  20. object EntityDecoder

    EntityDecoder is used to attempt to decode an EntityBody This companion object provides a way to create new EntityDecoders along with some commonly used instances which can be resolved implicitly.

  21. object EntityEncoder
  22. object EntityTag extends Serializable
  23. object FormDataDecoder
  24. object Header
  25. object Headers
  26. object Http

    Functions for creating Http kleislis.

  27. object HttpApp

    Functions for creating HttpApp kleislis.

  28. object HttpCodec
  29. object HttpDate
  30. object HttpRoutes

    Functions for creating HttpRoutes kleislis.

  31. object HttpVersion extends Serializable
  32. object LanguageTag extends Serializable
  33. object LiteralSyntaxMacros
  34. object Media
  35. object MediaRange
  36. object MediaType extends MimeDB
  37. object MediaTypePlaform
  38. object Message
  39. object Method extends Serializable
  40. object ParseFailure extends Serializable
  41. object ParseResult
  42. object ProductComment extends Serializable
  43. object ProductId extends Serializable
  44. object ProductIdOrComment
  45. object QValue extends QValuePlatform
  46. object QValuePlatform
  47. object Query
  48. object QueryParam
  49. object QueryParamCodec
  50. object QueryParamDecoder
  51. object QueryParamEncoder
  52. object QueryParamKeyLike
  53. object QueryParameterKey extends Serializable
  54. object QueryParameterValue extends Serializable
  55. object RangeUnit extends Serializable
  56. object Request extends Serializable
  57. object RequestCookie extends Serializable
  58. object Response extends Serializable
  59. object ResponseCookie extends Serializable
  60. object SameSite
  61. object ServerSentEvent extends Serializable
  62. object ServerSoftware extends Serializable
  63. object StaticFile
  64. object Status extends Serializable
  65. object TransferCoding
  66. object Uri extends UriPlatform with Serializable
  67. object UriPlatform
  68. object UriTemplate extends Serializable
  69. object UrlForm
  70. object WaitQueueTimeoutException extends TimeoutException with Product with Serializable
  71. object implicits extends AllSyntax

Deprecated Value Members

  1. val Http4sSyntax: all.type
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Moved to org.http4s.syntax.all

  2. object Http4s extends Http4s
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Use org.http4s.implicits._ instead

  3. object Http4sFunctions extends Http4sFunctions
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Use org.http4s.qvalue._ or org.http4s.Uri._ instead

  4. object Http4sInstances extends Http4sInstances
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Import from or use EntityDecoder/EntityEncoder directly instead

  5. object RequestCookieJar
    Annotations
    @deprecated
    Deprecated

    (Since version 0.21.20) Use the CookieJar middleware instead

Inherited from AnyRef

Inherited from Any

Ungrouped