-
Notifications
You must be signed in to change notification settings - Fork 2
Module: core::NetworkRequest
exported: default
kind: object
declaration: const
A network request
Type: object
kind: object
Type: object
kind: value
Type: string
kind: value
Type: string
kind: value
Type: string
kind: value
Type: Array.<Function>
kind: value
Type: boolean
kind: value
indicator flag whether or not the request is completed
Type: Promise
kind: value
Type: EventTarget
kind: value
constructor(url, config, config.method, config.type) => {NetworkRequest}
kind: function
The constructor for the NetworkRequest. It simply sets up the properties.
Name | Type | Description |
---|---|---|
url | string | the url this request should be made to |
config | object | addintional configuartion for the request |
config.method | string | |
config.type | string |
_make(args) => {void}
kind: function
use the constructor
[_make description]
Name | Type | Description |
---|---|---|
args | Array | [description] |
body(data) => {NetworkRequest}
kind: function
this method will set the given object as the request body.
Name | Type | Description |
---|---|---|
data | object | body data for this request |
headers(headers) => {NetworkRequest}
kind: function
This method will set the request headers, in case custom headers are required.
Name | Type | Description |
---|---|---|
headers | object | a object with all header properties for this request |
setHeader(key, value) => {NetworkRequest}
kind: function
Sets a single header for this request.
Name | Type | Description |
---|---|---|
key | string | the header key |
value | string | the header value |
onReady(fn) => {void}
kind: function
sets a callback for when the request is ready
Name | Type | Description |
---|---|---|
fn | Function | a callback function as soon as the data is ready |
send() => {Promise}
kind: function
This will actually create the network connection and initiate the request.
cancel() => {undefined}
kind: function
cancels an already sent request.