This makes XHR now rely on Fetch, which allows it to correct send
Origin and Referer headers, CORS-preflight and filtering and many other
goodies.
The main thing that's missing is Streams, which means we can't properly
produce progress events or switch to the Loading ready state.
This also doesn't implement the Document responseType just yet.
The intent is to use these to autogenerate prototype declarations for
Window and WorkerGlobalScope classes.
And the spec links are just nice to have :^)
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 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 allows you to ignore the Content-Type returned by the server and
always parse the content as if it's the given MIME type.
This will currently be used for allowing you to override the charset
of text responses.