The class that wraps anything for auto conversion to JSON or XML
The class that wraps anything for auto conversion to JSON or XML
a trait that extracts the JSON body from a request It is composed with a TestXXX to get the correct thing for the extractor
a trait that extracts the JSON body from a request It is composed with a TestXXX to get the correct thing for the extractor
A trait that defines the TestDelete extractor.
A trait that defines the TestDelete extractor. Is the request a DELETE and something that expects JSON or XML in the response. Subclass this trait to change the behavior
A trait that defines the TestGet extractor.
A trait that defines the TestGet extractor. Is the request a GET and something that expects JSON or XML in the response. Subclass this trait to change the behavior
A trait that defines the TestPost extractor.
A trait that defines the TestPost extractor. Is the request a POST, has JSON or XML data in the post body and something that expects JSON or XML in the response. Subclass this trait to change the behavior
A trait that defines the TestPut extractor.
A trait that defines the TestPut extractor. Is the request a PUT, has JSON or XML data in the put body and something that expects JSON or XML in the response. Subclass this trait to change the behavior
A trait that defines the TestReq extractor.
A trait that defines the TestReq extractor. Is the request something that expects JSON, XML in the response. Subclass this trait to change the behavior
a trait that extracts the XML body from a request It is composed with a TestXXX to get the correct thing for the extractor
a trait that extracts the XML body from a request It is composed with a TestXXX to get the correct thing for the extractor
Extract a Pair using the same syntax that you use to make a Pair
Extract a Pair using the same syntax that you use to make a Pair
An extractor that tests the request to see if it's a DELETE and if it is, the path and the request are extracted.
An extractor that tests the request to see if it's a DELETE and
if it is, the path and the request are extracted. It can
be used as:
case "api" :: id :: _ Delete req => ...
case Delete("api" :: id :: _, req) => ...
case Delete("api" :: id :: _, req) => ...
case "api" :: id :: _ Delete req => ...
or
case Delete("api" :: id :: _, req) => ...
case Delete("api" :: id :: _, req) => ...
An extractor that tests the request to see if it's a GET and if it is, the path and the request are extracted.
An extractor that tests the request to see if it's a GET and
if it is, the path and the request are extracted. It can
be used as:
case "api" :: id :: _ Get req => ...
case Get("api" :: id :: _, req) => ...
case Get("api" :: id :: _, req) => ...
case "api" :: id :: _ Get req => ...
or
case Get("api" :: id :: _, req) => ...
case Get("api" :: id :: _, req) => ...
The stable identifier for JsonDelete.
The stable identifier for JsonDelete. You can use it as an extractor.
The stable identifier for JsonGet.
The stable identifier for JsonGet. You can use it as an extractor.
The stable identifier for JsonPost.
The stable identifier for JsonPost. You can use it as an extractor.
The stable identifier for JsonPut.
The stable identifier for JsonPut. You can use it as an extractor.
The stable identifier for JsonReq.
The stable identifier for JsonReq. You can use it as an extractor.
An extractor that tests the request to see if it's an OPTIONS and if it is, the path and the request are extracted.
An extractor that tests the request to see if it's an OPTIONS and
if it is, the path and the request are extracted. It can
be used as:
case "api" :: id :: _ Options req => ...
case Options("api" :: id :: _, req) => ...
case Options("api" :: id :: _, req) => ...
case "api" :: id :: _ Options req => ...
or
case Options("api" :: id :: _, req) => ...
case Options("api" :: id :: _, req) => ...
An extractor that tests the request to see if it's a POST and if it is, the path and the request are extracted.
An extractor that tests the request to see if it's a POST and
if it is, the path and the request are extracted. It can
be used as:
case "api" :: id :: _ Post req => ...
case Post("api" :: id :: _, req) => ...
case Post("api" :: id :: _, req) => ...
case "api" :: id :: _ Post req => ...
or
case Post("api" :: id :: _, req) => ...
case Post("api" :: id :: _, req) => ...
An extractor that tests the request to see if it's a PUT and if it is, the path and the request are extracted.
An extractor that tests the request to see if it's a PUT and
if it is, the path and the request are extracted. It can
be used as:
case "api" :: id :: _ Put req => ...
case Put("api" :: id :: _, req) => ...
case Put("api" :: id :: _, req) => ...
case "api" :: id :: _ Put req => ...
or
case Put("api" :: id :: _, req) => ...
case Put("api" :: id :: _, req) => ...
The stable identifier for XmlDelete.
The stable identifier for XmlDelete. You can use it as an extractor.
The stable identifier for XmlGet.
The stable identifier for XmlGet. You can use it as an extractor.
The stable identifier for XmlPost.
The stable identifier for XmlPost. You can use it as an extractor.
The stable identifier for XmlPut.
The stable identifier for XmlPut. You can use it as an extractor.
The stable identifier for XmlReq.
The stable identifier for XmlReq. You can use it as an extractor.
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
Apply the Rest helper
Apply the Rest helper
If we're returning a future, then automatically turn the request into an Async request
If we're returning a future, then automatically turn the request into an Async request
the type
Nothing
If we're returning a future, then automatically turn the request into an Async request
If we're returning a future, then automatically turn the request into an Async request
the type
Nothing
Wrap a Box of anything for autoconversion to JSON or XML
Wrap a Box of anything for autoconversion to JSON or XML
wrap anything for autoconversion to JSON or XML
wrap anything for autoconversion to JSON or XML
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)
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)
An implicit conversion that converts AutoJsonXmlAble into JSON or XML
An implicit conversion that converts AutoJsonXmlAble into JSON or XML
The default way to convert a JsonXmlAble into JSON or XML
The default way to convert a JsonXmlAble into JSON or XML
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
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.
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.
Return the implicit Formats instance for JSON conversion
Return the implicit Formats instance for JSON conversion
Is the Rest helper defined for a given request
Is the Rest helper defined for a given request
Convert a JsCmd to a LiftResponse
Convert a JsExp to a LiftResponse
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
Convert a JValue to a LiftResponse
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
a SuperString with more available methods such as roboSplit or commafy
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 _ => ...
})
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
Convert a Node to an XmlResponse
Convert a Node to an XmlResponse
Turn an Option[T] into the return type expected by DispatchPF.
Turn an Option[T] into the return type expected by DispatchPF.
Turn an Option[T] into the return type expected by DispatchPF.
Turn an Option[T] into the return type expected by DispatchPF.
Add request handlers
Add request handlers
Serve a request returning either JSON or XML.
Serve a request returning either JSON or XML.
-- a Partial Function that converts the request into an intermediate response.
-- 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.
Serve a request returning either JSON or XML.
Serve a request returning either JSON or XML.
-- a Partial Function that converts the request into Any (note that the response must be convertable into JSON vis Lift JSON Extraction.decompose
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).
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).
-- a function that determines the response type based on the Req.
-- a PartialFunction that converts the request to a response type (e.g., a case class that contains the response).
-- a function that converts from the response type to a the appropriate LiftResponse based on the selected response type.
a SuperString with more available methods such as roboSplit or commafy
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
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
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
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
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.
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.
Mix this trait into a class to provide a list of REST helper methods