Class: RequestDirective

RequestDirective

RequestDirective traverses a `$request` directive and turns the definitions there into executable functions.

Constructor

new RequestDirective()

Source:
Example

Example schema

{
 "$request":
   "nullRequest": {
     "href": "/dev/null",
     "method": "GET",
     "@onSuccess": "self.doSomething",
     "@onError": "self.fixError",
     "@params": "self.query"
   }
 }

Methods

send(schema) → {Promise}

send the request
Parameters:
Name Type Description
schema Object A request schema object that is used to build the request.
Properties
Name Type Attributes Description
method String
href String
adapter RequestAdapter <optional>
onSuccess function <optional>
onError function <optional>
engine HTTPEngine <optional>
Source:
Returns:
Type
Promise