1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00
serenity/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.idl
Kenneth Myhra 247951e09c LibWeb: Add URLSearchParams as part of union type for XHR::send()
This patch adds support for URLSearchParams to XHR::send() and
introduces the union type XMLHttpRequestBodyInit.

XHR::send() now has support for String and URLSearchParams.
2022-07-08 12:37:01 +02:00

44 lines
1.3 KiB
Text

#import <XHR/XMLHttpRequestEventTarget.idl>
#import <DOM/EventHandler.idl>
#import <URL/URLSearchParams.idl>
typedef (URLSearchParams or USVString) XMLHttpRequestBodyInit;
enum XMLHttpRequestResponseType {
"",
"arraybuffer",
"blob",
"document",
"json",
"text"
};
interface XMLHttpRequest : XMLHttpRequestEventTarget {
constructor();
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;
readonly attribute unsigned short status;
readonly attribute DOMString responseText;
readonly attribute any response;
attribute XMLHttpRequestResponseType responseType;
attribute unsigned long timeout;
undefined open(DOMString method, DOMString url);
undefined open(ByteString method, USVString url, boolean async, optional USVString? username = {}, optional USVString? password = {});
undefined setRequestHeader(DOMString name, DOMString value);
undefined send(optional XMLHttpRequestBodyInit? body = null);
ByteString? getResponseHeader(ByteString name);
ByteString getAllResponseHeaders();
undefined overrideMimeType(DOMString mime);
attribute EventHandler onreadystatechange;
};