true if this resource allows POST
requests to be serviced when the resource does not exist,
false otherwise
default - false
list of scalamachine.core.HTTPMethods allowed by this resource
default - List(GET)
this functions determines the charset of the response body and influences whether or not the request
can be serviced by this resource based on the Accept-Charset
.
this functions determines the charset of the response body and influences whether or not the request
can be serviced by this resource based on the Accept-Charset
. If the charset is acceptable,
the charsetting function will be run. See information about the return value for more.
The charsetting function is of type Array[Byte] => Array[Byte]
An optional list of provided charsets. If None
, charset short-circuiting is used and no charsetting is performed.
However, if
Some containing a list of 2-tuples of charsets and charsetting functions, the chosen charsetting function
will be applied the response body.
default - None
true if Content-*
headers are valid, false otherwise
default - true
Used during PUT
requests and POST
requests if postIsCreate
returns true.
Used during PUT
requests and POST
requests if postIsCreate
returns true. Returns a list
of accepted Content-Type
s and their associated handler functions. The handler functions
have the signature ReqRespData
=> (Res[Boolean],ReqRespData)
. If the handler returns true
it is considered successful, otherwise it is considered to have failed and to be an error.
If the Content-Type
of the request is not acceptable a response with code 415 is returned
a list of 2-tuples containing the accepted content types and their associated handlers
default - Nil
This function determines the body of GET/HEAD requests.
This function determines the body of GET/HEAD requests. If your resource responds to them, make sure to implement it
because the default most likely will not do. It should return a list of 2-tuples containing the content type and its
associated body rendering function. The body rendering function has signature
ReqRespData => (Res[Array[Byte],ReqRespData)
list of 2-tuples from the scalamachine.core.ContentType to the rendering function.
default - by default resources provice the text/html
content type, rendering a simple HTML response
Use for POST
requests that represent creation of data.
Use for POST
requests that represent creation of data. Makes handling somewhat similar to
a PUT
request ultimately
if this function is called it must return Some
containing the created path,
returning None is considered an error
need to elaborate more on what happens with the returned path and what exactly the string should be
default - None
true if the deletion is complete at the time this function is called, false otherwise
default - true
Perform the deletion of the resource during a DELETE
request
Perform the deletion of the resource during a DELETE
request
true if the deletion succeed (does not necessarily have to complete), false otherwise
default - false
similar to scalamachine.core.Resource.charsetsProvided except for response encoding
default - supports the "identity" encoding
if Some
the date will be set as the value of the Expires
header in the response
default - None
the _etag_, if any, for the resource to be included in the response or to determine if the cached response is fresh
default - None
scalamachine.core.AuthSuccess if request is authorized scalamachine.core.AuthFailure otherwise
default - AuthSuccess
true if the PUT
request cannot be handled due to conflict, false otherwise
default - false
true if request is forbidden, false otherwise
default - false
true if content type is known, false otherwise
default - true
true if the accepted language is available
change to real content negotiation like ruby port
default - true
true if the request is malformed, false otherwise
default - false
true if request body length is valid, false otherwise
default - true
list of scalamachine.core.HTTPMethods known by this resource
default - List(OPTIONS, TRACE, CONNECT, HEAD, GET, POST, PUT, DELETE)
the last modified date of the resource being requested, if any, included in response or to determine if cached response is fresh
default - None
None if the resource has not been moved, Some, contain the URI of its new location otherwise
default - None
None if the resource is not moved temporarily, Some containing its temporary URI otherwise
default - None
additional headers to include in the reponse to an OPTIONS
request
default - no additional headers
Determines whether or not createPath
or processPost
is called during a POST
request
Determines whether or not createPath
or processPost
is called during a POST
request
true will cause the resource to follow a path that calls createPath
, false will
result in the flow calling processPost
default - false
true if the resource existed before, although it does not now, false otherwise
default - false
Used for POST
requests that represent generic processing on a resource, instead of creation
Used for POST
requests that represent generic processing on a resource, instead of creation
true of the processing succeeded, false otherwise
default - false
for most resources that access a datasource this is where that access should most likely be performed and placed into a variable in the resource (or the resource's context -- coming soon)
for most resources that access a datasource this is where that access should most likely be performed and placed into a variable in the resource (or the resource's context -- coming soon)
true if the resource exists, false otherwise
default - true
true if the service(s) necessary to service this resource are available, false otherwise
default - true
true if the request URI is too long, otherwise false
default - false
headers to be included in the Vary
response header.
Accept
, Accept-Encoding
, Accept-Charset
will always be included and do not need to be in the returned list
default - Nil
Resources represent HTTP resources in an application's API.
Applications should subclass this trait and implement the functions necessary for its resources' logic.