Packageorg.restfulx.controllers.mock
Classpublic class MockAuxHTTPController
InheritanceMockAuxHTTPController Inheritance AuxHTTPController Inheritance flash.events.EventDispatcher

This class allows re-routing of AuxHTTPController send method to the specified Rx.httpControllerHandler function. This is useful for mocking AuxHTTPController calls or doing something entirely different with them.



Public Methods
 MethodDefined by
  
MockAuxHTTPController(optsOrOnResult:Object = null, onFault:Function = null, contentType:String = "application/x-www-form-urlencoded", resultFormat:String = "e4x", serializer:ISerializer = null, rootUrl:String = null)
MockAuxHTTPController
 Inherited
invoke(optsOrURL:Object, data:Object = null, method:Boolean, unmarshall:String = "false", cacheBy:Object = null, httpHeaders:* = null):void
Invokes a specified URL using indicated method and passing provided data.
AuxHTTPController
  
send(url:String, data:Object = null, method:int, responder:IResponder = null, httpHeaders:Object = null):void
A different take on invoke.
MockAuxHTTPController
Protected Methods
 MethodDefined by
 Inherited
addHeaders(request:URLRequest, headers:Object):void
AuxHTTPController
 Inherited
defaultFaultHandler(info:Object, token:Object = null):void
AuxHTTPController
 Inherited
defaultResultHandler(data:Object, token:Object = null):void
AuxHTTPController
 Inherited
marshallToURLVariables(source:Object):URLVariables
AuxHTTPController
 Inherited
unmarshall(data:Object):Object
AuxHTTPController
 Inherited
unmarshallAndCacheResultHandler(data:Object, token:Object = null):void
AuxHTTPController
 Inherited
unmarshallResultHandler(data:Object, token:Object = null):void
AuxHTTPController
Public Constants
 ConstantDefined by
 InheritedDELETE : int = 4
[static]
AuxHTTPController
 InheritedGET : int = 1
[static]
AuxHTTPController
 InheritedPOST : int = 2
[static]
AuxHTTPController
 InheritedPUT : int = 3
[static]
AuxHTTPController
Constructor detail
MockAuxHTTPController()constructor
public function MockAuxHTTPController(optsOrOnResult:Object = null, onFault:Function = null, contentType:String = "application/x-www-form-urlencoded", resultFormat:String = "e4x", serializer:ISerializer = null, rootUrl:String = null)

Parameters
optsOrOnResult:Object (default = null) — can be either an anonymous object of options or a result handler function.
 
onFault:Function (default = null) — function to call on HTTPService error or if unmarshalling fails
 
contentType:String (default = "application/x-www-form-urlencoded") — content type for the request
 
resultFormat:String (default = "e4x") — what to treat the response as (e.g. e4x, text)
 
serializer:ISerializer (default = null) — what serializer to use (default is XML)
 
rootUrl:String (default = null) — the URL to prefix to requests
Method detail
send()method
public override function send(url:String, data:Object = null, method:int, responder:IResponder = null, httpHeaders:Object = null):void

A different take on invoke. Can be used with standalone org.restfulx.controllers.ICommand implementations if they also implement IResponder interface.

Parameters
url:String — URL to call
 
data:Object (default = null) — data to pass along
 
method:int — method to use
 
responder:IResponder (default = null) — IResponder implementation to callback.
 
httpHeaders:Object (default = null) — an object (key, value pairs) of HTTP headers to send along with this request