org.http4s.dsl.impl

Members list

Type members

Classlikes

object +&

Multiple param extractor:

Multiple param extractor:

object A extends QueryParamDecoderMatcher[String]("a")
object B extends QueryParamDecoderMatcher[Int]("b")
val routes = HttpRoutes.of {
  case GET -> Root / "user" :? A(a) +& B(b) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
+&.type
object ->

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
->.type
object ->>

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
->>.type
object /

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
/.type
object /:

Path separator extractor:

Path separator extractor:

Path("/1/2/3/test.json") match {
  case "1" /: "2" /: _ =>  ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
/:.type
object :?

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
:?.type
trait AllowResponseGenerator[F[_], G[_]] extends ResponseGenerator

Helper for the generation of a org.http4s.Response which must contain an Allow header and may contain a body.

Helper for the generation of a org.http4s.Response which must contain an Allow header and may contain a body.

A 405 status MUST contain an Allow header, which distinguishes this from other ResponseGenerators.

Attributes

Source
ResponseGenerator.scala
Supertypes
class Any
Known subtypes
class MethodNotAllowedOps[F, G]
trait Auth

Attributes

Source
Auth.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait RequestDsl
trait Http4sDsl2[F, G]
trait Http4sDsl[F]
object io
object request
Show all
trait EmptyResponseGenerator[F[_], G[_]] extends ResponseGenerator

Helper for the generation of a org.http4s.Response which will not contain a body

Helper for the generation of a org.http4s.Response which will not contain a body

While it is possible to for the org.http4s.Response manually, the EntityResponseGenerators offer shortcut syntax to make intention clear and concise.

Attributes

Example

val resp: F[Response] = Status.Continue()
Source
ResponseGenerator.scala
Supertypes
class Any
Known subtypes
class ContinueOps[F, G]
class EarlyHintsOps[F, G]
class NoContentOps[F, G]
class NotModifiedOps[F, G]
class ResetContentOps[F, G]
class SwitchingProtocolsOps[F, G]
Show all
trait EntityResponseGenerator[F[_], G[_]] extends ResponseGenerator

Helper for the generation of a org.http4s.Response which may contain a body

Helper for the generation of a org.http4s.Response which may contain a body

While it is possible to construct the org.http4s.Response manually, the EntityResponseGenerators offer shortcut syntax to make intention clear and concise.

Attributes

Example

val resp: IO[Response] = Ok("Hello world!")
Source
ResponseGenerator.scala
Supertypes
class Any
Known subtypes
class FoundOps[F, G]
class MovedPermanentlyOps[F, G]
class MultipleChoicesOps[F, G]
class PermanentRedirectOps[F, G]
class SeeOtherOps[F, G]
class TemporaryRedirectOps[F, G]
class AcceptedOps[F, G]
class AlreadyReportedOps[F, G]
class BadGatewayOps[F, G]
class BadRequestOps[F, G]
class ConflictOps[F, G]
class CreatedOps[F, G]
class ExpectationFailedOps[F, G]
class FailedDependencyOps[F, G]
class ForbiddenOps[F, G]
class GatewayTimeoutOps[F, G]
class GoneOps[F, G]
class IMUsedOps[F, G]
class LengthRequiredOps[F, G]
class LockedOps[F, G]
class LoopDetectedOps[F, G]
class MisdirectedRequestOps[F, G]
class MultiStatusOps[F, G]
class NotAcceptableOps[F, G]
class NotExtendedOps[F, G]
class NotFoundOps[F, G]
class NotImplementedOps[F, G]
class OkOps[F, G]
class PartialContentOps[F, G]
class PayloadTooLargeOps[F, G]
class PaymentRequiredOps[F, G]
class PreconditionFailedOps[F, G]
class RequestTimeoutOps[F, G]
class ServiceUnavailableOps[F, G]
class TooEarlyOps[F, G]
class TooManyRequestsOps[F, G]
class UpgradeRequiredOps[F, G]
class UriTooLongOps[F, G]
Show all
abstract class FlagQueryParamMatcher(name: String)

Flag (value-less) query param extractor

Flag (value-less) query param extractor

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
object IntVar

Integer extractor of a path variable:

Integer extractor of a path variable:

Path("/user/123") match {
   case Root / "user" / IntVar(userId) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
IntVar.type
trait LocationResponseGenerator[F[_], G[_]] extends EntityResponseGenerator[F, G]

Helper for the generation of a org.http4s.Response which may contain a Location header and may contain a body.

Helper for the generation of a org.http4s.Response which may contain a Location header and may contain a body.

A 300, 301, 302, 303, 307 and 308 status SHOULD contain a Location header, which distinguishes this from other EntityResponseGenerators.

Attributes

Source
ResponseGenerator.scala
Supertypes
class Any
Known subtypes
class FoundOps[F, G]
class MovedPermanentlyOps[F, G]
class MultipleChoicesOps[F, G]
class PermanentRedirectOps[F, G]
class SeeOtherOps[F, G]
class TemporaryRedirectOps[F, G]
Show all
object LongVar

Long extractor of a path variable:

Long extractor of a path variable:

Path("/user/123") match {
   case Root / "user" / LongVar(userId) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LongVar.type
abstract class MatrixVar[F[_]](name: String, domain: F[String])(implicit evidence$1: Foldable[F])

Matrix path variable extractor For an example see MatrixURIs This is useful for representing a resource that may be addressed in multiple dimensions where order is unimportant

Matrix path variable extractor For an example see MatrixURIs This is useful for representing a resource that may be addressed in multiple dimensions where order is unimportant

object BoardVar extends MatrixVar("square", List("x", "y"))
Path("/board/square;x=5;y=3") match {
  case Root / "board" / BoardVar(IntVar(x), IntVar(y)) => ...
}

Attributes

Companion
object
Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
object MatrixVar

Attributes

Companion
class
Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
MatrixVar.type
class MethodConcat(val methods: Set[Method])

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
trait Methods

Attributes

Source
Methods.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait RequestDsl
trait Http4sDsl2[F, G]
trait Http4sDsl[F]
object io
object request
Show all
abstract class OptionalMultiQueryParamDecoderMatcher[T](name: String)(implicit evidence$1: QueryParamDecoder[T])

Capture a query parameter that appears 0 or more times.

Capture a query parameter that appears 0 or more times.

case class Foo(i: Int)
implicit val fooDecoder: QueryParamDecoder[Foo] = ...
implicit val fooParam: QueryParam[Foo] = ...

object FooMatcher extends OptionalMultiQueryParamDecoderMatcher[Foo]("foo")
val routes = HttpRoutes.of {
  // matches http://.../closest?foo=2&foo=3&foo=4
  case GET -> Root / "closest" :? FooMatcher(Validated.Valid(Seq(Foo(2),Foo(3),Foo(4)))) => ...

  /*
  *  matches http://.../closest?foo=2&foo=3&foo=4 as well as http://.../closest (no parameters)
  *  or http://.../closest?foo=2 (single occurrence)
  */
  case GET -> Root / "closest" :? FooMatcher(is) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
abstract class OptionalQueryParamDecoderMatcher[T](name: String)(implicit evidence$1: QueryParamDecoder[T])

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
abstract class OptionalValidatingQueryParamDecoderMatcher[T](name: String)(implicit evidence$1: QueryParamDecoder[T])

param extractor using org.http4s.QueryParamDecoder.

param extractor using org.http4s.QueryParamDecoder. Note that this will _always_ match, but will return an Option possibly containing the result of the conversion to T

case class Foo(i: Int)
implicit val fooDecoder: QueryParamDecoder[Foo] = ...

case class Bar(i: Int)
implicit val barDecoder: QueryParamDecoder[Bar] = ...

object FooMatcher extends ValidatingQueryParamDecoderMatcher[Foo]("foo")
object BarMatcher extends OptionalValidatingQueryParamDecoderMatcher[Bar]("bar")

val routes = HttpRoutes.of {
  case GET -> Root / "closest" :? FooMatcher(fooValue) +& BarMatcher(barValue) =>
    ^(fooValue, barValue getOrElse 42.right) { (foo, bar) =>
      ...
    }.fold(
      nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")),
      baz  => { ... }
    )

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any

Helper for the generation of a org.http4s.Response which must contain a Proxy-Authenticate header and may contain a body.

Helper for the generation of a org.http4s.Response which must contain a Proxy-Authenticate header and may contain a body.

A 407 status MUST contain a Proxy-Authenticate header, which distinguishes this from other EntityResponseGenerators.

Attributes

Source
ResponseGenerator.scala
Supertypes
class Any
abstract class QueryParamDecoderMatcher[T](name: String)(implicit evidence$1: QueryParamDecoder[T])

param extractor using QueryParamDecoder:

param extractor using QueryParamDecoder:

case class Foo(i: Int)
implicit val fooDecoder: QueryParamDecoder[Foo] = ...

object FooMatcher extends QueryParamDecoderMatcher[Foo]("foo")
val routes = HttpRoutes.of {
  case GET -> Root / "closest" :? FooMatcher(2) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class QueryParamDecoderMatcherWithDefault[T](name: String, default: T)(implicit evidence$1: QueryParamDecoder[T])

A param extractor with a default value.

A param extractor with a default value. If the query param is not present, the default value is returned If the query param is present but incorrectly formatted, will return None

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class QueryParamMatcher[T] extends QueryParamDecoderMatcher[T]

param extractor using QueryParamDecoder:

param extractor using QueryParamDecoder:

case class Foo(i: Int)
implicit val fooDecoder: QueryParamDecoder[Foo] = ...
implicit val fooParam: QueryParam[Foo] = ...

object FooMatcher extends QueryParamDecoderMatcher[Foo]
val routes = HttpRoutes.of {
  case GET -> Root / "closest" :? FooMatcher(2) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
abstract class QueryParamMatcherWithDefault[T](default: T)(implicit evidence$1: QueryParamDecoder[T], evidence$2: QueryParam[T]) extends QueryParamDecoderMatcherWithDefault[T]

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Source
ResponseGenerator.scala
Supertypes
class Any
Known subtypes
class MethodNotAllowedOps[F, G]
class ContinueOps[F, G]
class EarlyHintsOps[F, G]
class NoContentOps[F, G]
class NotModifiedOps[F, G]
class ResetContentOps[F, G]
class SwitchingProtocolsOps[F, G]
class FoundOps[F, G]
class MovedPermanentlyOps[F, G]
class MultipleChoicesOps[F, G]
class PermanentRedirectOps[F, G]
class SeeOtherOps[F, G]
class TemporaryRedirectOps[F, G]
class AcceptedOps[F, G]
class AlreadyReportedOps[F, G]
class BadGatewayOps[F, G]
class BadRequestOps[F, G]
class ConflictOps[F, G]
class CreatedOps[F, G]
class ExpectationFailedOps[F, G]
class FailedDependencyOps[F, G]
class ForbiddenOps[F, G]
class GatewayTimeoutOps[F, G]
class GoneOps[F, G]
class IMUsedOps[F, G]
class LengthRequiredOps[F, G]
class LockedOps[F, G]
class LoopDetectedOps[F, G]
class MisdirectedRequestOps[F, G]
class MultiStatusOps[F, G]
class NotAcceptableOps[F, G]
class NotExtendedOps[F, G]
class NotFoundOps[F, G]
class NotImplementedOps[F, G]
class OkOps[F, G]
class PartialContentOps[F, G]
class PayloadTooLargeOps[F, G]
class PaymentRequiredOps[F, G]
class PreconditionFailedOps[F, G]
class RequestTimeoutOps[F, G]
class ServiceUnavailableOps[F, G]
class TooEarlyOps[F, G]
class TooManyRequestsOps[F, G]
class UpgradeRequiredOps[F, G]
class UriTooLongOps[F, G]
class UnauthorizedOps[F, G]
Show all
trait Responses[F[_], G[_]]

Attributes

Companion
object
Source
Responses.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Http4sDsl2[F, G]
trait Http4sDsl[F]
object io
object Responses

Attributes

Companion
trait
Source
Responses.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Responses.type
trait Statuses

Attributes

Source
Statuses.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Http4sDsl2[F, G]
trait Http4sDsl[F]
object io
object UUIDVar

UUID extractor of a path variable:

UUID extractor of a path variable:

Path("/user/13251d88-7a73-4fcf-b935-54dfae9f023e") match {
   case Root / "user" / UUIDVar(userId) => ...

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
UUIDVar.type
abstract class ValidatingQueryParamDecoderMatcher[T](name: String)(implicit evidence$1: QueryParamDecoder[T])

param extractor using org.http4s.QueryParamDecoder.

param extractor using org.http4s.QueryParamDecoder. Note that this will return a ParseFailure if the parameter cannot be decoded.

case class Foo(i: Int)
implicit val fooDecoder: QueryParamDecoder[Foo] = ...

object FooMatcher extends ValidatingQueryParamDecoderMatcher[Foo]("foo")
val routes: HttpRoutes.of = {
  case GET -> Root / "closest" :? FooMatcher(fooValue) =>
    fooValue.fold(
      nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")),
      foo  => { ... }
    )

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any

Helper for the generation of a org.http4s.Response which must contain a WWW-Authenticate header and may contain a body.

Helper for the generation of a org.http4s.Response which must contain a WWW-Authenticate header and may contain a body.

A 401 status MUST contain a WWW-Authenticate header, which distinguishes this from other ResponseGenerators.

Attributes

Source
ResponseGenerator.scala
Supertypes
class Any
Known subtypes
class UnauthorizedOps[F, G]
object ~

File extension extractor

File extension extractor

Attributes

Source
Path.scala
Supertypes
class Object
trait Matchable
class Any
Self type
~.type