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

LibWeb: Add XMLHttpRequest::open() overload

This adds the XMLHttpRequest::open(String, String, bool, String, String)
overload.

The following FIXMEs has been implemented:
- If method is not a method, then throw a "SyntaxError" DOMException.
- If the username argument is not null, set the username given parsedURL
  and username.
- If the password argument is not null, set the password given parsedURL
  and password.
- Set this’s synchronous flag if async is false; otherwise unset this’s
  synchronous flag.

Spec comments has also been updated.
This commit is contained in:
Kenneth Myhra 2022-04-03 18:43:02 +02:00 committed by Andreas Kling
parent 0b86574293
commit 69f05a66fc
3 changed files with 51 additions and 15 deletions

View file

@ -55,6 +55,7 @@ public:
Bindings::XMLHttpRequestResponseType response_type() const { return m_response_type; }
DOM::ExceptionOr<void> open(String const& method, String const& url);
DOM::ExceptionOr<void> open(String const& method, String const& url, bool async, String const& username = {}, String const& password = {});
DOM::ExceptionOr<void> send(String body);
DOM::ExceptionOr<void> set_request_header(String const& header, String const& value);