Modules
The following methods and properties are located under pz.http namespace, or via @plazarjs/http module depending on the environment.
Properties
Name
Description
defaultDataType
The format of the response.
Default: 'json'
Default: 'json'
latestRequestId internal
Unique Id (guid) of the last executed request.
Methods
Name
Description
abort (all)
Aborts latest or all requests that are currently executing.
delete (options)
- Creates and invokes an AJAX DELETE request based on passed options.
-
Parameters:
- ● options: Object
- Returns: created request
- This is a shorthand of pz.http.request method.
get (options)
- Creates and invokes an AJAX GET request based on passed options.
-
Parameters:
- ● options: Object
- Returns: created request
- This is a shorthand of pz.http.request method.
post (options)
- Creates and invokes an AJAX POST request based on passed options.
-
Parameters:
- ● options: Object
- Returns: created request
- This is a shorthand of pz.http.request method.
put (options)
- Creates and invokes an AJAX PUT request based on passed options.
-
Parameters:
- ● options: Object
- Returns: created request
- This is a shorthand of pz.http.request method.
request (options)
- Creates and invokes an AJAX request based on passed options.
-
Parameters:
- ● options: Object
- Passed options can contain the following properties:
-
- ● url: String
- ● method: String
- ● data: Object (optional) This is internally converted to a json string.
- ● dataType: String (optional) The format of the response, default: 'json'
- ● success: Function (optional)
- ● fail: Function (optional)
- ● abort: Function (optional)
- ● params: Object (optional) A key/value pairs which will be used to create a routed url. Useful when invoking a get request, for example.
- ● headers: Object (optional) A key/value pairs which will be used to set the request headers.
- ● timeout: Number (optional) A number of milliseconds this request can take before terminating. After a timeout, abort callback is called.
- Returns: created request
- Example usage: