2022-11-10 20:11:25 +01:00
|
|
|
#import <DOM/Document.idl>
|
2022-03-30 23:35:42 +03:00
|
|
|
#import <DOM/EventHandler.idl>
|
2022-09-21 23:14:40 +01:00
|
|
|
#import <Fetch/BodyInit.idl>
|
|
|
|
|
#import <XHR/XMLHttpRequestEventTarget.idl>
|
2023-02-28 18:27:52 +00:00
|
|
|
#import <XHR/XMLHttpRequestUpload.idl>
|
2022-02-15 22:40:51 +03:30
|
|
|
|
2022-02-15 14:35:29 +03:30
|
|
|
enum XMLHttpRequestResponseType {
|
2023-10-25 17:27:19 +02:00
|
|
|
"",
|
|
|
|
|
"arraybuffer",
|
|
|
|
|
"blob",
|
|
|
|
|
"document",
|
|
|
|
|
"json",
|
|
|
|
|
"text"
|
2022-02-15 14:35:29 +03:30
|
|
|
};
|
|
|
|
|
|
2022-10-07 16:45:09 -06:00
|
|
|
// https://xhr.spec.whatwg.org/#xmlhttprequest
|
2023-09-03 02:00:01 +12:00
|
|
|
[Exposed=(Window,DedicatedWorker,SharedWorker)]
|
2021-01-23 17:52:16 +00:00
|
|
|
interface XMLHttpRequest : XMLHttpRequestEventTarget {
|
2021-01-23 13:23:17 +01:00
|
|
|
|
2021-02-17 22:53:20 +01:00
|
|
|
constructor();
|
|
|
|
|
|
2023-10-25 17:27:19 +02:00
|
|
|
// event handler
|
|
|
|
|
attribute EventHandler onreadystatechange;
|
|
|
|
|
|
|
|
|
|
// states
|
2021-01-23 13:23:17 +01:00
|
|
|
const unsigned short UNSENT = 0;
|
|
|
|
|
const unsigned short OPENED = 1;
|
|
|
|
|
const unsigned short HEADERS_RECEIVED = 2;
|
|
|
|
|
const unsigned short LOADING = 3;
|
|
|
|
|
const unsigned short DONE = 4;
|
|
|
|
|
readonly attribute unsigned short readyState;
|
|
|
|
|
|
2023-10-25 17:27:19 +02:00
|
|
|
// request
|
2021-01-23 13:23:17 +01:00
|
|
|
undefined open(DOMString method, DOMString url);
|
2023-02-28 18:27:52 +00:00
|
|
|
undefined open(ByteString method, USVString url, boolean async, optional USVString? username = null, optional USVString? password = null);
|
2024-11-21 17:02:09 +00:00
|
|
|
undefined setRequestHeader(ByteString name, ByteString value);
|
2023-10-25 17:27:19 +02:00
|
|
|
attribute unsigned long timeout;
|
|
|
|
|
attribute boolean withCredentials;
|
|
|
|
|
[SameObject] readonly attribute XMLHttpRequestUpload upload;
|
2022-11-10 20:11:25 +01:00
|
|
|
undefined send(optional (Document or XMLHttpRequestBodyInit)? body = null);
|
2022-11-05 03:35:02 +00:00
|
|
|
undefined abort();
|
2021-01-23 13:23:17 +01:00
|
|
|
|
2023-10-25 17:27:19 +02:00
|
|
|
// response
|
2024-05-01 11:10:15 +02:00
|
|
|
readonly attribute USVString responseURL;
|
2023-10-25 17:27:19 +02:00
|
|
|
readonly attribute unsigned short status;
|
|
|
|
|
readonly attribute ByteString statusText;
|
2021-04-03 15:51:15 +02:00
|
|
|
ByteString? getResponseHeader(ByteString name);
|
2021-09-19 22:32:33 +02:00
|
|
|
ByteString getAllResponseHeaders();
|
2022-02-11 21:04:42 +00:00
|
|
|
undefined overrideMimeType(DOMString mime);
|
2023-10-25 17:27:19 +02:00
|
|
|
attribute XMLHttpRequestResponseType responseType;
|
|
|
|
|
readonly attribute any response;
|
|
|
|
|
readonly attribute DOMString responseText;
|
2025-06-30 23:29:30 +01:00
|
|
|
[Exposed=Window] readonly attribute Document? responseXML;
|
2021-09-19 01:40:13 +02:00
|
|
|
|
2021-01-23 13:23:17 +01:00
|
|
|
};
|