AjaxRequest class Null safety

Class that represents a JavaScript XMLHttpRequest object.


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


action AjaxRequestAction?
Indicates the AjaxRequestAction that can be used to control the XMLHttpRequest request.
read / write
data ↔ dynamic
Data passed as a parameter to the XMLHttpRequest.send() method.
read / write
event AjaxRequestEvent?
Event type of the XMLHttpRequest request.
read / write
hashCode int
The hash code for this object.
read-only, inherited
headers AjaxRequestHeaders?
The HTTP request headers.
read / write
isAsync bool?
An optional Boolean parameter, defaulting to true, indicating whether or not the request is performed asynchronously.
read / write
method String?
The HTTP request method of the XMLHttpRequest request.
read / write
password String?
The optional password to use for authentication purposes; by default, this is the null value.
read / write
readyState AjaxRequestReadyState?
The state of the XMLHttpRequest request.
read / write
response ↔ dynamic
The response's body content. The content-type depends on the AjaxRequest.reponseType.
read / write
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.
read / write
responseText String?
The text received from a server following a request being sent.
read / write
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.
read / write
responseURL Uri?
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.
read / write
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.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
status int?
The numerical HTTP status code of the XMLHttpRequest's response.
read / write
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".
read / write
url Uri?
The URL of the XMLHttpRequest request.
read / write
user String?
The optional user name to use for authentication purposes; by default, this is the null value.
read / write
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.
read / write


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toJson() Map<String, dynamic>
toMap() Map<String, dynamic>
toString() String
A string representation of this object.


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

Static Methods

fromMap(Map<String, dynamic>? map) AjaxRequest?