responseHandler

  • typedef
can.fixture.types.responseHandler

{function(status, statusText, responses, headers)}

 

Specifies the response of an AJAX request.

response(status [,statusText], responses, headers)

Specify a HTTP response.

Parameters

  1. status {Number}

    The HTTP response code. Ex: 200.

  2. statusText {String}Optional

    the status text of the response. Ex: "success" for 200.

  3. responses {Object<typeName,*>}

    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.

  4. headers {Object<headerName,String>}

    HTTP response headers and values.

response(responses)

Specify the body of a successful HTTP response.

Parameters

  1. responses {Object<typeName,*>}

    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.