AjaxRequest class

Class that represents a JavaScript XMLHttpRequest object.

Constructors

AjaxRequest({AjaxRequestAction? action = AjaxRequestAction.PROCEED, dynamic data, AjaxRequestEvent? event, AjaxRequestHeaders? headers, bool? isAsync, String? method, String? password, AjaxRequestReadyState? readyState, dynamic response, Map<String, dynamic>? responseHeaders, String? responseText, String? responseType, WebUri? responseURL, String? responseXML, int? status, String? statusText, WebUri? url, String? user, bool? withCredentials})

Properties

action AjaxRequestAction?
Indicates the AjaxRequestAction that can be used to control the XMLHttpRequest request.
getter/setter pair
data ↔ dynamic
Data passed as a parameter to the XMLHttpRequest.send() method.
getter/setter pair
event AjaxRequestEvent?
Event type of the XMLHttpRequest request.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers AjaxRequestHeaders?
The HTTP request headers.
getter/setter pair
isAsync bool?
An optional Boolean parameter, defaulting to true, indicating whether or not the request is performed asynchronously.
getter/setter pair
method String?
The HTTP request method of the XMLHttpRequest request.
getter/setter pair
password String?
The optional password to use for authentication purposes; by default, this is the null value.
getter/setter pair
readyState AjaxRequestReadyState?
The state of the XMLHttpRequest request.
getter/setter pair
response ↔ dynamic
The response's body content. The content-type depends on the AjaxRequest.responseType.
getter/setter pair
responseHeaders Map<String, dynamic>?
All the response headers or returns null if no response has been received. If a network error happened, an empty string is returned.
getter/setter pair
responseText String?
The text received from a server following a request being sent.
getter/setter pair
responseType String?
It is an enumerated string value specifying the type of data contained in the response. It also lets the author change the response type. If an empty string is set as the value of responseType, the default value of text is used.
getter/setter pair
responseURL WebUri?
The serialized URL of the response or the empty string if the URL is null. If the URL is returned, any URL fragment present in the URL will be stripped away. The value of responseURL will be the final URL obtained after any redirects.
getter/setter pair
responseXML String?
The HTML or XML string retrieved by the request or null if the request was unsuccessful, has not yet been sent, or if the data can't be parsed as XML or HTML.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int?
The numerical HTTP status code of the XMLHttpRequest's response.
getter/setter pair
statusText String?
A String containing the response's status message as returned by the HTTP server. Unlike AjaxRequest.status which indicates a numerical status code, this property contains the text of the response status, such as "OK" or "Not Found". If the request's readyState is in AjaxRequestReadyState.UNSENT or AjaxRequestReadyState.OPENED state, the value of statusText will be an empty string. If the server response doesn't explicitly specify a status text, statusText will assume the default value "OK".
getter/setter pair
url WebUri?
The URL of the XMLHttpRequest request.
getter/setter pair
user String?
The optional user name to use for authentication purposes; by default, this is the null value.
getter/setter pair
withCredentials bool?
The XMLHttpRequest.withCredentials property is a Boolean that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. Setting withCredentials has no effect on same-site requests. In addition, this flag is also used to indicate when cookies are to be ignored in the response. The default is false.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts instance to a map.
toMap() Map<String, dynamic>
Converts instance to a map.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromMap(Map<String, dynamic>? map) AjaxRequest?
Gets a possible AjaxRequest instance from a Map value.