Convenience value for utf-8
Convenience method to return an exception as a 500 Internal Error with the body being the message of the exception
Utility method to return HttpResponse with status OK and a serialized json body via Jackson.
Utility method to return HttpResponse with status OK and a serialized json body via Jackson. If the JSON processing is CPU intensive, it should be done in a background thread, dedicated actor, etc... into an http body with the content type set
the type to serialize from
the object to serialize
an HttpResponse containing an OK StatusCode and the serialized object
Merge two parameter maps into one
Merge two parameter maps into one
the first map
the second map
a merged map containing members from both maps
Parse a query string into a Map of key-value String pairs.
Parse a query string into a Map of key-value String pairs. Ignores invalid key-value pairs in the query string
the query string to parse, without the leading '?'
key/value pairs mapping to the items in the query string
Parse a query string into a List of key-value String pairs
Parse a query string into a List of key-value String pairs
the query string to parse (without the '?')
a list of (String, String), representing each key-value pair in the query string
Attempt to parse the incoming request.
Attempt to parse the incoming request.
the full request
the piece of data that should be converted to the suggested type
the parsed request, or a Failure response
Utility method to serialize a json body via jackson.
Utility method to serialize a json body via jackson. If the JSON processing is CPU intensive, it should be done in a background thread, dedicated actor, etc... into an http body with the content type set Enforces the return of application/json as a content type, since this always serializes to json
the type to serialize from
the object to serialize
an HttpResponse containing either the desired HttpEntity, or an error entity
Used to convert error objects into JSON format.
Used to convert error objects into JSON format.
type of object
object to convert
JSONified body
Used under the covers to force simple error strings into a JSON format
Used under the covers to force simple error strings into a JSON format
the body
an HttpEntity containing an error JSON body
The message to be sent back with the WWW-Authenticate
header when the request is
unauthorized.
The message to be sent back with the WWW-Authenticate
header when the request is
unauthorized. This particular form works around a known Android quirk.
See discussion at http://stackoverflow.com/questions/6114455/
the message
Convenience methods for interacting with URLs and other parts of an HTTP request.
Methods found within spray.http objects should be preferred over these, wherever Spray objects are already in use. For example, if working with a spray.http.Uri, prefer to access its query string pairs using [spray.http.Uri.Query$.toMap] instead of using
parseQueryStringToMap
found here