com.sksamuel.scruffy

HttpEndpointProvider

Related Doc: package scruffy

trait HttpEndpointProvider extends ResponseBuilder with ResponseConversions with DefaultProcessors

A trait that provides the entry point to the DSL.

Classes / objects that contain the endpoints for your application should extend this trait and call the get/post/delete/etc methods, providing the path to match on and the function chain.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpEndpointProvider
  2. DefaultProcessors
  3. SessionProcessors
  4. QueryParamProcessors
  5. HeaderProcessors
  6. EntityProcessors
  7. CookieProcessors
  8. ContentTypeProcessors
  9. ResponseConversions
  10. ResponseBuilder
  11. AnyRef
  12. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. implicit class FutureOps[T] extends AnyRef

    Definition Classes
    ResponseConversions

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. implicit def ToFutureOps[A](a: A): HttpEndpointProvider.FutureOps[A] { def self: A }

    Definition Classes
    ResponseBuilder
  5. def accepted: Response

    Definition Classes
    ResponseBuilder
  6. def ajax(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Processor that requires the request to identify itself as an ajax request by incuding the X-Requested-With header set to value "XMLRequest"

    Processor that requires the request to identify itself as an ajax request by incuding the X-Requested-With header set to value "XMLRequest"

    Definition Classes
    DefaultProcessors
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def badGateway: Response

    Definition Classes
    ResponseBuilder
  9. def badRequest(reason: String): Response

    Definition Classes
    ResponseBuilder
  10. def badRequest: Response

    Definition Classes
    ResponseBuilder
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def conflict: Response

    Definition Classes
    ResponseBuilder
  13. def consumes(mediaTypes: MediaType*)(p: ⇒ Future[Response])(implicit req: Request): Future[Response]

    A Processor that will reject a request with 415 Unsupported Media Type if the content type of the request does not match one of the given content types.

    A Processor that will reject a request with 415 Unsupported Media Type if the content type of the request does not match one of the given content types.

    mediaTypes

    the media types accepted by this processor

    p

    the inner processor

    req

    the outer http request

    returns

    the inner processors http response

    Definition Classes
    ContentTypeProcessors
  14. def contentTypeOverride(mediaType: MediaType)(p: (Request) ⇒ Future[Response])(implicit req: Request): Future[Response]

    A processor that sets the content type of the request.

    A processor that sets the content type of the request.

    Definition Classes
    ContentTypeProcessors
  15. def cookie(name: String)(f: (Cookie) ⇒ Future[Response])(implicit req: Request): Future[Response]

    Adds a processor to the pipeline that requires the request to have a cookie with the given name.

    Adds a processor to the pipeline that requires the request to have a cookie with the given name. If the request does not contain the cookie then processing will skip to the next endpoint. The processor does not inspect the cookie value.

    name

    the cookie name that must be present on the request

    returns

    this

    Definition Classes
    CookieProcessors
  16. def created: Response

    Definition Classes
    ResponseBuilder
  17. def define(method: HttpMethod, url: String, p: (Request) ⇒ Future[Response]): HttpEndpoint

    Attributes
    protected
  18. def delete(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  19. def emptyBody(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    EntityProcessors
  20. def entityAs[E](f: (E) ⇒ Future[Response])(implicit arg0: Manifest[E], req: Request): Future[Response]

    Definition Classes
    EntityProcessors
  21. implicit def entityFutureToResponseFuture(f: Future[Any]): Future[Response]

    Definition Classes
    ResponseConversions
  22. def entitySizeLimit(size: Int)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    EntityProcessors
  23. implicit def entityToResponseFuture(any: Any): Future[Response]

    Definition Classes
    ResponseConversions
  24. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  26. implicit val executor: ExecutionContext

  27. def expectationFailed: Response

    Definition Classes
    ResponseBuilder
  28. def filter(filter: Filter): Unit

    Adds a filter that will run before each of the endpoints defined in this provider.

    Adds a filter that will run before each of the endpoints defined in this provider.

    Filters are only executed once per request, so if an endpoint skips to another endpoint, the filter will not be re-executed.

    Note: Endpoint Provider specific filters (ie, filters added here) will be executed after server-wide specific filters (those registered with the endpoint container).

  29. var filters: ListBuffer[FilterHolder]

    Attributes
    protected[com.sksamuel.scruffy]
  30. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. def forbidden(reason: String): Response

    Definition Classes
    ResponseBuilder
  32. def forbidden: Response

    Definition Classes
    ResponseBuilder
  33. def found: Response

    Definition Classes
    ResponseBuilder
  34. def gatewayTimeout: Response

    Definition Classes
    ResponseBuilder
  35. def get(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  36. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  37. def gone: Response

    Definition Classes
    ResponseBuilder
  38. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  39. def head(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  40. def header(name: String, value: Any)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    A processor that requires the request to have a header with the given name and value.

    A processor that requires the request to have a header with the given name and value. If the request does not contain the header then processing will skip to the next endpoint.

    Definition Classes
    HeaderProcessors
  41. def header(name: HeaderName, value: Any)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    HeaderProcessors
  42. def header(name: String)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Adds a processor to the pipeline that requires the request to have a header with the given name.

    Adds a processor to the pipeline that requires the request to have a header with the given name. The value is not inspected as part of this pipeline. If the request does not contain the header then processing will skip to the next endpoint.

    name

    the header that must be present on the request

    returns

    this

    Definition Classes
    HeaderProcessors
  43. def header(name: HeaderName)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Adds a processor to the pipeline that requires the request to have a header with the given name.

    Adds a processor to the pipeline that requires the request to have a header with the given name. The value is not inspected as part of this pipeline. If the request does not contain the header then processing will skip to the next endpoint.

    name

    the header that must be present on the request

    returns

    this

    Definition Classes
    HeaderProcessors
  44. def hostname(regex: String)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    DefaultProcessors
  45. def http(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    DefaultProcessors
  46. val httpEndpoints: ListBuffer[HttpEndpoint]

    Attributes
    protected[com.sksamuel.scruffy]
  47. def https(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    DefaultProcessors
  48. def ifMatch(name: String)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    DefaultProcessors
  49. def internalServerError(reason: String): Response

    Definition Classes
    ResponseBuilder
  50. def internalServerError: Response

    Definition Classes
    ResponseBuilder
  51. def ipAddress(regex: String)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    DefaultProcessors
  52. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  53. def json(p: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Adjusts the response from the inner processor by setting its content type to json

    Adjusts the response from the inner processor by setting its content type to json

    Definition Classes
    ContentTypeProcessors
  54. def lengthRequired: Response

    Definition Classes
    ResponseBuilder
  55. def methodNotAllowed: Response

    Definition Classes
    ResponseBuilder
  56. def movedPermanently: Response

    Definition Classes
    ResponseBuilder
  57. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  58. def nocontent: Response

    Definition Classes
    ResponseBuilder
  59. implicit def nodeToResponseFuture(node: Node): Future[Response]

    Definition Classes
    ResponseConversions
  60. def nonAuthoritativeInformation: Response

    Definition Classes
    ResponseBuilder
  61. def nonEmptyBody(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    EntityProcessors
  62. def notAcceptable: Response

    Definition Classes
    ResponseBuilder
  63. def notFound(body: String): Response

    Definition Classes
    ResponseBuilder
  64. def notFound: Response

    Definition Classes
    ResponseBuilder
  65. def notImplemented: Response

    Definition Classes
    ResponseBuilder
  66. def notImplemented(reason: String): Response

    Definition Classes
    ResponseBuilder
  67. def notModified: Response

    Definition Classes
    ResponseBuilder
  68. final def notify(): Unit

    Definition Classes
    AnyRef
  69. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  70. def ok(ent: Any, contentType: MediaType): Response

    Creates a Response, which is a 200 OK, with the given entity set as the payload with the given content-type.

    Creates a Response, which is a 200 OK, with the given entity set as the payload with the given content-type.

    Definition Classes
    ResponseBuilder
  71. def ok(ent: Any, contentType: String): Response

    Creates a Response, which is a 200 OK, with the given entity set as the payload with the given content-type.

    Creates a Response, which is a 200 OK, with the given entity set as the payload with the given content-type.

    Definition Classes
    ResponseBuilder
  72. def ok(e: Any): Response

    Creaes a 200 ok response with the entity set to the given value, and the content type inferred.

    Creaes a 200 ok response with the entity set to the given value, and the content type inferred.

    Definition Classes
    ResponseBuilder
  73. def ok: Response

    Definition Classes
    ResponseBuilder
  74. def option2response(option: Option[_]): Response

    Definition Classes
    ResponseConversions
  75. implicit def optionFutureToResponseFuture(f: Future[Option[_]]): Future[Response]

    Definition Classes
    ResponseConversions
  76. implicit def optionToResponseFuture(o: Option[_]): Future[Response]

    Definition Classes
    ResponseConversions
  77. def options(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  78. def param(name: String, value: String)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    QueryParamProcessors
  79. def param(name: String)(f: (String) ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    QueryParamProcessors
  80. def partialContent: Response

    Definition Classes
    ResponseBuilder
  81. def paymentRequired: Response

    Definition Classes
    ResponseBuilder
  82. def permanentRedirect(location: String): Response

    Definition Classes
    ResponseBuilder
  83. def post(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  84. def preconditionFailed: Response

    Definition Classes
    ResponseBuilder
  85. def proxyAuthenticationRequired: Response

    Definition Classes
    ResponseBuilder
  86. def put(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  87. def rateLimit(requestsPerSecond: Double, warmupPeriod: FiniteDuration)(f: ⇒ Future[Response]): Future[Response]

    Definition Classes
    DefaultProcessors
  88. def rateLimit(limiter: RateLimiter)(f: ⇒ Future[Response]): Future[Response]

    Definition Classes
    DefaultProcessors
  89. def requestEntityTooLarge: Response

    Definition Classes
    ResponseBuilder
  90. def requestHeaderFieldsTooLarge: Response

    Definition Classes
    ResponseBuilder
  91. def requestTimeout: Response

    Definition Classes
    ResponseBuilder
  92. def requestURITooLong: Response

    Definition Classes
    ResponseBuilder
  93. def requestedRangeNotSatisfiable: Response

    Definition Classes
    ResponseBuilder
  94. def resetContent: Response

    Definition Classes
    ResponseBuilder
  95. implicit def responseToResponseFuture(resp: Response): Future[Response]

    Definition Classes
    ResponseConversions
  96. implicit def scalazValidation2responseFuture(v: ValidationNel[_, _]): Future[Response]

    Definition Classes
    ResponseConversions
  97. implicit def scalazValidationFuture2responseFuture(f: Future[ValidationNel[_, _]]): Future[Response]

    Definition Classes
    ResponseConversions
  98. def seeOther(location: String): Response

    Definition Classes
    ResponseBuilder
  99. def serviceUnavailable: Response

    Definition Classes
    ResponseBuilder
  100. def session(f: (Session) ⇒ Future[Response])(implicit req: Request): Future[Response]

    Extracts the current session.

    Extracts the current session. If no such session exists then will exit the route with a 500 Internal Service Error.

    Definition Classes
    SessionProcessors
  101. def sessionManager(manager: SessionManager)(f: (Session) ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    SessionProcessors
  102. def sessionProperty[T](key: SessionKey[T])(f: (T) ⇒ Future[Response])(implicit req: Request): Future[Response]

    Extracts a property from the session.

    Extracts a property from the session. If the session does not exist then the endpoint will return a 500 Internal Service Error. If the property does not exist in the session then the route will return a 500 Internal Service Error.

    Definition Classes
    SessionProcessors
  103. def status(s: Int): Response

    Builds a Response with the status code set to a HttpStatus which has the value of the given int.

    Builds a Response with the status code set to a HttpStatus which has the value of the given int.

    Eg, status(200) will return a Response of 200

    Definition Classes
    ResponseBuilder
  104. def status(s: HttpStatus): Response

    Builds a Response with the status code set the given HttpStatus

    Builds a Response with the status code set the given HttpStatus

    Eg, status(HttpStatus.OK) will return a Response of 200

    Definition Classes
    ResponseBuilder
  105. implicit def statusToResponse(s: HttpStatus): Response

    Definition Classes
    ResponseConversions
  106. implicit def statusToResponseFuture(s: HttpStatus): Future[Response]

    Definition Classes
    ResponseConversions
  107. implicit def stringFutureToResponseFuture(f: Future[String]): Future[Response]

    Definition Classes
    ResponseConversions
  108. implicit def stringToResponseFuture(str: String): Future[Response]

    Definition Classes
    ResponseConversions
  109. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  110. def temporaryRedirect(location: String): Response

    Definition Classes
    ResponseBuilder
  111. def toString(): String

    Definition Classes
    AnyRef → Any
  112. def tooManyRequests: Response

    Definition Classes
    ResponseBuilder
  113. def trace(url: String)(p: (Request) ⇒ Future[Response]): HttpEndpoint

  114. def try2response(t: Try[_]): Response

    Definition Classes
    ResponseConversions
  115. implicit def try2responseFuture(t: Try[_]): Future[Response]

    Definition Classes
    ResponseConversions
  116. implicit def tryFuture2responseFuture(f: Future[Try[_]]): Future[Response]

    Definition Classes
    ResponseConversions
  117. def unauthorized: Response

    Definition Classes
    ResponseBuilder
  118. def unit2response(unit: Unit): Response

    Definition Classes
    ResponseConversions
  119. implicit def unit2responseFuture(unit: Unit): Future[Response]

    Definition Classes
    ResponseConversions
  120. implicit def unitFuture2responseFuture(f: Future[Unit]): Future[Response]

    Definition Classes
    ResponseConversions
  121. def unprocessableEntity(reason: String): Response

    Definition Classes
    ResponseBuilder
  122. def unprocessableEntity: Response

    Definition Classes
    ResponseBuilder
  123. def unsupportedMediaType: Response

    Definition Classes
    ResponseBuilder
  124. def useProxy: Response

    Definition Classes
    ResponseBuilder
  125. def userAgent(regex: String)(f: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Definition Classes
    HeaderProcessors
  126. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  127. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  128. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  129. def xml(p: ⇒ Future[Response])(implicit req: Request): Future[Response]

    Creates a Response, which is a 200 OK, with the given entity set as an XML payload.

    Creates a Response, which is a 200 OK, with the given entity set as an XML payload.

    Definition Classes
    ContentTypeProcessors

Inherited from DefaultProcessors

Inherited from SessionProcessors

Inherited from QueryParamProcessors

Inherited from HeaderProcessors

Inherited from EntityProcessors

Inherited from CookieProcessors

Inherited from ContentTypeProcessors

Inherited from ResponseConversions

Inherited from ResponseBuilder

Inherited from AnyRef

Inherited from Any

Ungrouped