net.liftweb.http.rest

RestHelper

trait RestHelper extends PartialFunction[Req, () ⇒ Box[LiftResponse]]

Mix this trait into a class to provide a list of REST helper methods

Linear Supertypes
PartialFunction[Req, () ⇒ Box[LiftResponse]], (Req) ⇒ () ⇒ Box[LiftResponse], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. RestHelper
  2. PartialFunction
  3. Function1
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Type Members

  1. case class AutoJsonXmlAble (obj: Any) extends Product with Serializable

    The class that wraps anything for auto conversion to JSON or XML

  2. trait JsonBody extends AnyRef

    a trait that extracts the JSON body from a request It is composed with a TestXXX to get the correct thing for the extractor

  3. trait JsonTest extends AnyRef

    Attributes
    protected
  4. type JxCvtPF [T] = PartialFunction[(JsonXmlSelect, T, Req), LiftResponse]

    Attributes
    protected
  5. trait TestDelete extends AnyRef

    A trait that defines the TestDelete extractor.

  6. trait TestGet extends AnyRef

    A trait that defines the TestGet extractor.

  7. trait TestPost [T] extends AnyRef

    A trait that defines the TestPost extractor.

  8. trait TestPut [T] extends AnyRef

    A trait that defines the TestPut extractor.

  9. trait TestReq extends AnyRef

    A trait that defines the TestReq extractor.

  10. trait XmlBody extends AnyRef

    a trait that extracts the XML body from a request It is composed with a TestXXX to get the correct thing for the extractor

  11. trait XmlTest extends AnyRef

    Attributes
    protected

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. object -> extends AnyRef

    Extract a Pair using the same syntax that you use to make a Pair

  5. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  6. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  7. object Delete extends AnyRef

    An extractor that tests the request to see if it's a DELETE and if it is, the path and the request are extracted.

  8. object Get extends AnyRef

    An extractor that tests the request to see if it's a GET and if it is, the path and the request are extracted.

  9. lazy val JsonDelete : TestDelete with JsonTest

    The stable identifier for JsonDelete.

    The stable identifier for JsonDelete. You can use it as an extractor.

    Attributes
    protected
  10. lazy val JsonGet : TestGet with JsonTest

    The stable identifier for JsonGet.

    The stable identifier for JsonGet. You can use it as an extractor.

    Attributes
    protected
  11. lazy val JsonPost : TestPost[JValue] with JsonTest with JsonBody

    The stable identifier for JsonPost.

    The stable identifier for JsonPost. You can use it as an extractor.

    Attributes
    protected
  12. lazy val JsonPut : TestPut[JValue] with JsonTest with JsonBody

    The stable identifier for JsonPut.

    The stable identifier for JsonPut. You can use it as an extractor.

    Attributes
    protected
  13. lazy val JsonReq : TestReq with JsonTest

    The stable identifier for JsonReq.

    The stable identifier for JsonReq. You can use it as an extractor.

    Attributes
    protected
  14. object Post extends AnyRef

    An extractor that tests the request to see if it's a POST and if it is, the path and the request are extracted.

  15. object Put extends AnyRef

    An extractor that tests the request to see if it's a PUT and if it is, the path and the request are extracted.

  16. lazy val XmlDelete : TestDelete with XmlTest

    The stable identifier for XmlDelete.

    The stable identifier for XmlDelete. You can use it as an extractor.

    Attributes
    protected
  17. lazy val XmlGet : TestGet with XmlTest

    The stable identifier for XmlGet.

    The stable identifier for XmlGet. You can use it as an extractor.

    Attributes
    protected
  18. lazy val XmlPost : TestPost[Elem] with XmlTest with XmlBody

    The stable identifier for XmlPost.

    The stable identifier for XmlPost. You can use it as an extractor.

    Attributes
    protected
  19. lazy val XmlPut : TestPut[Elem] with XmlTest with XmlBody

    The stable identifier for XmlPut.

    The stable identifier for XmlPut. You can use it as an extractor.

    Attributes
    protected
  20. lazy val XmlReq : TestReq with XmlTest

    The stable identifier for XmlReq.

    The stable identifier for XmlReq. You can use it as an extractor.

    Attributes
    protected
  21. def andThen [C] (k: (() ⇒ Box[LiftResponse]) ⇒ C): PartialFunction[Req, C]

    Definition Classes
    PartialFunction → Function1
  22. def anyToJValue (in: Any): Box[JValue]

    Take any value and convert it into a JValue.

    Take any value and convert it into a JValue. Full box if it works, empty if it does

    Attributes
    protected
  23. def apply (in: Req): () ⇒ Box[LiftResponse]

    Apply the Rest helper

    Apply the Rest helper

    Definition Classes
    RestHelper → Function1
  24. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  25. def auto (in: Box[Any]): Box[AutoJsonXmlAble]

    Wrap a Box of anything for autoconversion to JSON or XML

    Wrap a Box of anything for autoconversion to JSON or XML

    Attributes
    protected
  26. def auto (in: Any): Box[AutoJsonXmlAble]

    wrap anything for autoconversion to JSON or XML

    wrap anything for autoconversion to JSON or XML

    Attributes
    protected
  27. implicit def boxFuncToResp [T] (in: () ⇒ Box[T])(implicit c: (T) ⇒ LiftResponse): () ⇒ Box[LiftResponse]

    Turn a () => Box[T] into the return type expected by DispatchPF.

    Turn a () => Box[T] into the return type expected by DispatchPF. Note that this method will return messages from Failure() and return codes and messages from ParamFailure[Int[(msg, _, _, code)

    Attributes
    protected implicit
  28. implicit def boxToResp [T] (in: Box[T])(implicit c: (T) ⇒ LiftResponse): () ⇒ Box[LiftResponse]

    Turn a Box[T] into the return type expected by DispatchPF.

    Turn a Box[T] into the return type expected by DispatchPF. Note that this method will return messages from Failure() and return codes and messages from ParamFailure[Int[(msg, _, _, code)

    Attributes
    protected implicit
  29. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  30. def compose [A] (g: (A) ⇒ Req): (A) ⇒ () ⇒ Box[LiftResponse]

    Definition Classes
    Function1
  31. implicit lazy val convertAutoJsonXmlAble : PartialFunction[(JsonXmlSelect, AutoJsonXmlAble, Req), LiftResponse]

    An implicit conversion that converts AutoJsonXmlAble into JSON or XML

    An implicit conversion that converts AutoJsonXmlAble into JSON or XML

    Attributes
    protected implicit
  32. implicit lazy val convertJsonXmlAble : PartialFunction[(JsonXmlSelect, JsonXmlAble, Req), LiftResponse]

    The default way to convert a JsonXmlAble into JSON or XML

    The default way to convert a JsonXmlAble into JSON or XML

    Attributes
    protected implicit
  33. def createXmlResponse (in: Node): LiftResponse

    Override this method to create an AppXmlResponse with the mime type application/xml rather then text/xml

    Override this method to create an AppXmlResponse with the mime type application/xml rather then text/xml

    Attributes
    protected
  34. def defaultGetAsJson : Boolean

    If the headers and the suffix say nothing about the response type, should we default to JSON.

    If the headers and the suffix say nothing about the response type, should we default to JSON. By default, yes, override to change the behavior.

    Attributes
    protected
  35. def defaultGetAsXml : Boolean

    If the headers and the suffix say nothing about the response type, should we default to XML.

    If the headers and the suffix say nothing about the response type, should we default to XML. By default, no, override to change the behavior.

    Attributes
    protected
  36. def emptyToResp (eb: EmptyBox): Box[LiftResponse]

    Attributes
    protected
  37. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  38. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  39. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  40. implicit def formats : Formats

    Return the implicit Formats instance for JSON conversion

    Return the implicit Formats instance for JSON conversion

    Attributes
    protected implicit
  41. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  42. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  43. def isDefinedAt (in: Req): Boolean

    Is the Rest helper defined for a given request

    Is the Rest helper defined for a given request

    Definition Classes
    RestHelper → PartialFunction
  44. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  45. implicit def jsCmdToResp (in: JsCmd): LiftResponse

    Convert a JsCmd to a LiftResponse

    Convert a JsCmd to a LiftResponse

    Attributes
    implicit
  46. implicit def jsExpToResp (in: JsExp): LiftResponse

    Convert a JsExp to a LiftResponse

    Convert a JsExp to a LiftResponse

    Attributes
    implicit
  47. def jsonResponse_? (in: Req): Boolean

    Will the request accept a JSON response? Yes if the Accept header contains "text/json", "application/json" or the Accept header is missing or contains "star/star" and the suffix is "json".

    Will the request accept a JSON response? Yes if the Accept header contains "text/json", "application/json" or the Accept header is missing or contains "star/star" and the suffix is "json". Override this method to provide your own logic. If there's no suffix, no accepts (or it's "star/star") then look to either the Content-Type header or the defaultGetAsJson flag

    Attributes
    protected
  48. implicit def jsonToResp (in: JValue): LiftResponse

    Convert a JValue to a LiftResponse

    Convert a JValue to a LiftResponse

    Attributes
    implicit
  49. implicit def jxSel (req: Req): BoxOrRaw[JsonXmlSelect]

    A function that chooses JSON or XML based on the request.

    A function that chooses JSON or XML based on the request.. Use with serveType

    Attributes
    implicit
  50. def lift : (Req) ⇒ Option[() ⇒ Box[LiftResponse]]

    Definition Classes
    PartialFunction
  51. implicit def listStringToSuper (in: List[String]): SuperListString

    returns

    a SuperString with more available methods such as roboSplit or commafy

    Attributes
    protected implicit
  52. implicit def listToServeMagic (in: List[String]): ListServeMagic

    Allows you to use >> after a path list to handle all the cases where you have a prefix for a series of differ suffixes with the same path prefix.

    Allows you to use >> after a path list to handle all the cases where you have a prefix for a series of differ suffixes with the same path prefix. For example: serve("foo" / "bar" >> { case baz :: Nil Post _ => ... case Nil Get _ => ... })

    Attributes
    protected implicit
  53. def mergeJson (original: JValue, toMerge: JValue): JValue

    Take an original piece of JSON (most probably, JObject and replace all the JFields with those in toMerge

    Take an original piece of JSON (most probably, JObject and replace all the JFields with those in toMerge

    Attributes
    protected
  54. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  55. implicit def nodeToResp (in: Node): LiftResponse

    Convert a Node to an XmlResponse

    Convert a Node to an XmlResponse

    Attributes
    protected implicit
  56. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  57. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  58. implicit def optionFuncToResp [T] (in: () ⇒ Option[T])(implicit c: (T) ⇒ LiftResponse): () ⇒ Box[LiftResponse]

    Turn an Option[T] into the return type expected by DispatchPF.

    Turn an Option[T] into the return type expected by DispatchPF.

    Attributes
    protected implicit
  59. implicit def optionToResp [T] (in: Option[T])(implicit c: (T) ⇒ LiftResponse): () ⇒ Box[LiftResponse]

    Turn an Option[T] into the return type expected by DispatchPF.

    Turn an Option[T] into the return type expected by DispatchPF.

    Attributes
    protected implicit
  60. def orElse [A1 <: Req, B1 >: () ⇒ Box[LiftResponse]] (that: PartialFunction[A1, B1]): PartialFunction[A1, B1]

    Definition Classes
    PartialFunction
  61. def serve (handler: PartialFunction[Req, () ⇒ Box[LiftResponse]]): Unit

    Add request handlers

    Add request handlers

    Attributes
    protected
  62. def serveJx [T] (pf: PartialFunction[Req, BoxOrRaw[T]])(implicit cvt: JxCvtPF[T]): Unit

    Serve a request returning either JSON or XML.

    Serve a request returning either JSON or XML.

    cvt

    -- convert the intermediate response to a LiftResponse based on the request being for XML or JSON. If T is JsonXmlAble, there are built-in converters. Further, you can return auto(thing) and that will invoke built-in converters as well. The built-in converters use Lift JSON's Extraction.decompose to convert the object into JSON and then Xml.toXml() to convert to XML.

    Attributes
    protected
  63. def serveJxa (pf: PartialFunction[Req, BoxOrRaw[Any]]): Unit

    Serve a request returning either JSON or XML.

    Serve a request returning either JSON or XML.

    Attributes
    protected
  64. def serveType [T, SelectType] (selection: (Req) ⇒ BoxOrRaw[SelectType])(pf: PartialFunction[Req, BoxOrRaw[T]])(implicit cvt: PartialFunction[(SelectType, T, Req), LiftResponse]): Unit

    Serve a given request by determining the request type, computing the response and then converting the response to the given type (e.

    Serve a given request by determining the request type, computing the response and then converting the response to the given type (e.g., JSON or XML).

    selection

    -- a function that determines the response type based on the Req.

    cvt

    -- a function that converts from the response type to a the appropriate LiftResponse based on the selected response type.

    Attributes
    protected
  65. implicit def stringToSuper (in: String): SuperString

    returns

    a SuperString with more available methods such as roboSplit or commafy

    Attributes
    protected implicit
  66. def suplimentalJsonResponse_? (in: Req): Boolean

    If there are additional custom rules (e.

    If there are additional custom rules (e.g., looking at query parameters) you can override this method which is consulted if the other rules in jsonResponse_? fail

    Attributes
    protected
  67. def suplimentalXmlResponse_? (in: Req): Boolean

    If there are additional custom rules (e.

    If there are additional custom rules (e.g., looking at query parameters) you can override this method which is consulted if the other rules in xmlResponse_? fail

    Attributes
    protected
  68. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  69. implicit def thingToResp [T] (in: T)(implicit c: (T) ⇒ LiftResponse): () ⇒ Box[LiftResponse]

    Turn T into the return type expected by DispatchPF as long as we can convert T to a LiftResponse.

    Turn T into the return type expected by DispatchPF as long as we can convert T to a LiftResponse.

    Attributes
    protected implicit
  70. def toString (): String

    Definition Classes
    Function1 → AnyRef → Any
  71. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  74. def xmlResponse_? (in: Req): Boolean

    Will the request accept an XML response? Yes if the Accept header contains "application/xml" or "text/xml" or the Accept header is missing or contains "star/star" and the suffix is "xml".

    Will the request accept an XML response? Yes if the Accept header contains "application/xml" or "text/xml" or the Accept header is missing or contains "star/star" and the suffix is "xml". Override this method to provide your own logic. If there's no suffix, no accepts (or it's "star/star") then look to either the Content-Type header or the defaultGetAsXml flag.

    Attributes
    protected

Inherited from PartialFunction[Req, () ⇒ Box[LiftResponse]]

Inherited from (Req) ⇒ () ⇒ Box[LiftResponse]

Inherited from AnyRef

Inherited from Any