Constructor
new Ajax(m, urlopt, paramsopt, headersopt, nullable, contentopt, nullable)
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
m |
HttpMethod
|
HttpRq
|
|
Request method string or http.HttpRq |
url |
String
|
<optional>
|
|
params |
Object
|
<optional>
|
Request parameters object |
headers |
Object
|
<optional>
<nullable>
|
Headers object |
content |
HttpContent
|
<optional>
<nullable>
|
Optional http content HttpContent |
Members
rq :HttpRq
- Source:
- See:
-
Type:
- Source:
- See:
-
Type:
Methods
- Source:
Set header
Parameters:
Name |
Type |
Attributes |
Description |
n |
String
|
|
header name |
v |
String
|
<optional>
|
header value |
Returns:
-
Type
-
Ajax
- Source:
Add/Set headers
Parameters:
Name |
Type |
Description |
hdrs |
Object
|
headers object |
Returns:
-
Type
-
Ajax
onSuccess(callbackRqRs) → {Ajax}
- Source:
Parameters:
Name |
Type |
Description |
callbackRqRs |
function
|
|
Returns:
-
Type
-
Ajax
onUploadSuccess(callbackRqRs) → {Ajax}
- Source:
Parameters:
Name |
Type |
Description |
callbackRqRs |
function
|
|
Returns:
-
Type
-
Ajax
onFail(callbackRqRs) → {Ajax}
- Source:
Parameters:
Name |
Type |
Description |
callbackRqRs |
function
|
|
Returns:
-
Type
-
Ajax
onProgress(callbackRqRs) → {Ajax}
- Source:
Parameters:
Name |
Type |
Description |
callbackRqRs |
function
|
|
Returns:
-
Type
-
Ajax
onUploadProgress(callbackRqRs) → {Ajax}
- Source:
Parameters:
Name |
Type |
Description |
callbackRqRs |
function
|
|
Returns:
-
Type
-
Ajax
withContent(content) → {Ajax}
- Source:
Set custom content HttpContent
Parameters:
Name |
Type |
Description |
content |
HttpContent
|
|
Returns:
-
Type
-
Ajax
xmlData(data) → {Ajax}
- Source:
Set xml request data
Parameters:
Name |
Type |
Description |
data |
XMLDocument
|
|
Returns:
-
Type
-
Ajax
- Source:
Set form-data request data
Parameters:
Name |
Type |
Description |
form |
String
|
Node
|
|
Returns:
-
Type
-
Ajax
jsonData(data) → {Ajax}
- Source:
Set json request data
Parameters:
Name |
Type |
Description |
data |
String
|
Object
|
|
Returns:
-
Type
-
Ajax
urlEncodedData(data) → {Ajax}
- Source:
Set url-encoded request data
Parameters:
Name |
Type |
Description |
data |
Object
|
simple data object |
Returns:
-
Type
-
Ajax
send(finishCallbackopt) → {Ajax}
- Source:
Send XHR request
Parameters:
Name |
Type |
Attributes |
Description |
finishCallback |
function
|
<optional>
|
called after all other callbacks |
Returns:
-
Type
-
Ajax
(async) sendAsync() → {Promise.<Ajax>}
- Source:
Send request with Promise
Returns:
-
Type
-
Promise.<Ajax>