Module ringo/webapp/response
Functions
- errorResponse(msg)
- jsonResponse(object)
- notFoundResponse(location)
- redirectResponse(location)
- skinResponse(skin, context)
- staticResponse(resource, contentType)
- xmlResponse(xml)
Response ()
Response.prototype.charset
Response.prototype.close ()
Response.prototype.contentType
Response.prototype.debug ()
Print a debug message to the rendered page.
Response.prototype.flushDebug ()
Write the debug buffer to the response's main buffer.
Response.prototype.render (skin, context)
Render a skin to the response's buffer
Parameters
| skin | path to skin resource | |
| context | context object |
Response.prototype.status
Response.prototype.write ()
Response.prototype.writeln ()
jsonResponse (object)
Create a response object containing the JSON representation of an object.
Parameters
| Object | object | the object whose JSON representation to return |
notFoundResponse (location)
Create a 404 not-found response.
Parameters
| String | location | the location that couldn't be found |
redirectResponse (location)
Create a response that redirects the client to a different URL.
Parameters
| String | location | the new location |
skinResponse (skin, context)
A response object rendered from a skin.
Parameters
| Resource|String | skin | the skin resource or path. |
| Object | context | the skin context object |
staticResponse (resource, contentType)
A response representing a static resource.
Parameters
| String|Resource | resource | the resource to serve |
| String | contentType | optional MIME type. If not defined, the MIME type is detected from the file name extension. |
xmlResponse (xml)
Create a response containing the given XML document
Parameters
| XML|String | xml | an XML document |
