Fork me on GitHub

Module ringo/webapp/response

Functions

Class Response

Instance Methods

Instance Properties


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.getHeader (key)

Parameters

key

Response.prototype.redirect (location)

Parameters

location

Response.prototype.render (skin, context)

Render a skin to the response's buffer

Parameters

skin path to skin resource
context context object

Response.prototype.setHeader (key, value)

Parameters

key
value

Response.prototype.status


Response.prototype.write ()


Response.prototype.writeln ()


errorResponse (msg)

Create a 500 error response.

Parameters

String msg the message of response body

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