1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

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.
This commit is contained in:
Kenneth Myhra 2022-07-07 23:15:41 +02:00 committed by Linus Groh
parent bd74db157a
commit 247951e09c
4 changed files with 40 additions and 5 deletions

View file

@ -1,5 +1,8 @@
#import <XHR/XMLHttpRequestEventTarget.idl>
#import <DOM/EventHandler.idl>
#import <URL/URLSearchParams.idl>
typedef (URLSearchParams or USVString) XMLHttpRequestBodyInit;
enum XMLHttpRequestResponseType {
"",
@ -30,7 +33,7 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
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 USVString body = {});
undefined send(optional XMLHttpRequestBodyInit? body = null);
ByteString? getResponseHeader(ByteString name);
ByteString getAllResponseHeaders();