/* * Copyright (C)2005-2013 Haxe Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ // This file is generated, do not edit! package js.html; /**
XMLHttpRequest
is a JavaScript object that was designed by Microsoft and adopted by Mozilla, Apple, and Google. It's now being standardized in the W3C. It provides an easy way to retrieve data at a URL. Despite its name, XMLHttpRequest
can be used to retrieve any type of data, not just XML, and it supports protocols other than HTTP (including file
and ftp
).
To create an instance of XMLHttpRequest
, simply do this:
var req = new XMLHttpRequest();
For details about how to use XMLHttpRequest
, see Using XMLHttpRequest.
send()
has been called, and headers and status are available. */
static inline var HEADERS_RECEIVED : Int = 2;
/** Downloading; responseText
holds partial data. */
static inline var LOADING : Int = 3;
/** send()
has not been called yet. */
static inline var OPENED : Int = 1;
/** open()
has not been called yet. */
static inline var UNSENT : Int = 0;
var onabort : EventListener;
var onerror : EventListener;
var onload : EventListener;
var onloadend : EventListener;
var onloadstart : EventListener;
var onprogress : EventListener;
var onreadystatechange : EventListener;
/** The state of the request:
Value | State | Description |
0 | UNSENT | open() has not been called yet. |
1 | OPENED | send() has not been called yet. |
2 | HEADERS_RECEIVED | send() has been called, and headers and status are available. |
3 | LOADING | Downloading; responseText holds partial data. |
4 | DONE | The operation is complete. |
responseType
, as an ArrayBuffer
, Blob
, Document
, JavaScript object (for "moz-json"), or string. This is NULL
if the request is not complete or was not successful. Getter throws DOMException. */
var response(default,null) : Dynamic;
/** The response to the request as text, or null
if the request was unsuccessful or has not yet been sent. Read-only. Getter throws DOMException. */
var responseText(default,null) : String;
/** Can be set to change the response type. This tells the server what format you want the response to be in.
Value | Data type of response property |
empty string | String (this is the default) |
"arraybuffer" | ArrayBuffer |
"blob" | Blob
|
"document" | Document
|
"text" | String |
"moz-json" | JavaScript object, parsed from a JSON string returned by the server Requires Gecko 9.0 |
The response to the request as a DOM Document
object, or null
if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML. The response is parsed as if it were a text/xml
stream. Read-only.
text/xml
Content-Type header, you can use overrideMimeType()
to force XMLHttpRequest
to parse it as XML anyway.status
is 200 for a successful request). Read-only. Getter throws DOMException. */
var status(default,null) : Int;
/** The response string returned by the HTTP server. Unlike status
, this includes the entire text of the response message ("200 OK
", for example). Read-only. Getter throws DOMException. */
var statusText(default,null) : String;
/** The upload process can be tracked by adding an event listener to upload
.
New in Firefox 3.5 */
var upload(default,null) : XMLHttpRequestUpload;
/** Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. New in Firefox 3.5
The default is false
.
Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent. If the request is synchronous, this method doesn't return until the response has arrived.
send()
.body
nsIDocument
, nsIInputStream
, or a string (an nsISupportsString
if called from native code) that is used to populate the body of a POST request. Starting with Gecko 1.9.2, you may also specify an DOMFile
, and starting with Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
you may also specify a FormData
object.