| 1 |
wakaba |
1.1 |
interface XMLHttpRequestEventTarget : EventTarget { |
| 2 |
|
|
// event handler attributes |
| 3 |
|
|
attribute EventListener onabort; |
| 4 |
|
|
attribute EventListener onerror; |
| 5 |
|
|
attribute EventListener onload; |
| 6 |
|
|
attribute EventListener onloadstart; |
| 7 |
|
|
attribute EventListener onprogress; |
| 8 |
|
|
}; |
| 9 |
|
|
|
| 10 |
|
|
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget { |
| 11 |
|
|
// for future use |
| 12 |
|
|
}; |
| 13 |
|
|
|
| 14 |
|
|
[Constructor] interface XMLHttpRequest : XMLHttpRequestEventTarget { |
| 15 |
|
|
// event handler attributes |
| 16 |
|
|
attribute EventListener onreadystatechange; |
| 17 |
|
|
|
| 18 |
|
|
// ready states |
| 19 |
|
|
const unsigned short UNSENT = 0; |
| 20 |
|
|
const unsigned short OPENED = 1; |
| 21 |
|
|
const unsigned short HEADERS_RECEIVED = 2; |
| 22 |
|
|
const unsigned short LOADING = 3; |
| 23 |
|
|
const unsigned short DONE = 4; |
| 24 |
|
|
readonly attribute unsigned short readyState; |
| 25 |
|
|
|
| 26 |
|
|
// request metadata |
| 27 |
|
|
attribute boolean withCredentials; |
| 28 |
|
|
void open(in DOMString method, in DOMString url); |
| 29 |
|
|
void open(in DOMString method, in DOMString url, in boolean async); |
| 30 |
|
|
void open(in DOMString method, in DOMString url, in boolean async, [Null=Null, Undefined=Null] in DOMString user); |
| 31 |
|
|
void open(in DOMString method, in DOMString url, in boolean async, [Null=Null, Undefined=Null] in DOMString user, [Null=Null, Undefined=Null] in DOMString password); |
| 32 |
|
|
void setRequestHeader(in DOMString header, in DOMString value); |
| 33 |
|
|
|
| 34 |
|
|
// request |
| 35 |
|
|
readonly attribute XMLHttpRequestUpload upload; |
| 36 |
|
|
void send(); |
| 37 |
|
|
void send(in ByteArray data); |
| 38 |
|
|
void send([Null=Null, Undefined=Null] in DOMString data); |
| 39 |
|
|
void send(in Document data); |
| 40 |
|
|
void abort(); |
| 41 |
|
|
|
| 42 |
|
|
// response metadata |
| 43 |
|
|
DOMString getAllResponseHeaders(); |
| 44 |
|
|
DOMString getResponseHeader(in DOMString header); |
| 45 |
|
|
readonly attribute unsigned short status; |
| 46 |
|
|
readonly attribute DOMString statusText; |
| 47 |
|
|
|
| 48 |
|
|
// response body |
| 49 |
|
|
void overrideMimeType(in DOMString mime); |
| 50 |
|
|
readonly attribute ByteArray responseBody; |
| 51 |
|
|
readonly attribute DOMString responseText; |
| 52 |
|
|
readonly attribute Document responseXML; |
| 53 |
|
|
}; |