can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
41 lines (24 loc) • 1.21 kB
Markdown
function(Number,String,Object.<typeName,*>,headers)} can.fixture.types.responseHandler(status,statusText,responses,headers) responseHandler
can.fixture.types
Specifies the response of an AJAX request.
`response(status [,statusText], responses, headers)`
Specify a HTTP response.
{Number} status
The [HTTP response code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). Ex: `200`.
{String} [statusText] the status text of the response. Ex: "success"
for 200.
{Object.<typeName,*>} responses An object of responses by type. For example:
{
text: "{\"age\":5}"
}
If responses does not have a `typeName` property for the type of request, the
entire responses object is used as the response data.
{Object.<headerName,String>} headers HTTP response headers and values.
`response(responses)`
Specify the body of a successful HTTP response.
{Object.<typeName,*>} responses An object of responses by type. For example:
{
text: "{\"age\":5}"
}
If responses does not have a `typeName` property for the type of request, the
entire responses object is used as the response data.
{