XMLHttpRequest.idl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #import <DOM/Document.idl>
  2. #import <DOM/EventHandler.idl>
  3. #import <Fetch/BodyInit.idl>
  4. #import <XHR/XMLHttpRequestEventTarget.idl>
  5. #import <XHR/XMLHttpRequestUpload.idl>
  6. enum XMLHttpRequestResponseType {
  7. "",
  8. "arraybuffer",
  9. "blob",
  10. "document",
  11. "json",
  12. "text"
  13. };
  14. // https://xhr.spec.whatwg.org/#xmlhttprequest
  15. [Exposed=(Window,DedicatedWorker,SharedWorker), UseNewAKString]
  16. interface XMLHttpRequest : XMLHttpRequestEventTarget {
  17. constructor();
  18. const unsigned short UNSENT = 0;
  19. const unsigned short OPENED = 1;
  20. const unsigned short HEADERS_RECEIVED = 2;
  21. const unsigned short LOADING = 3;
  22. const unsigned short DONE = 4;
  23. readonly attribute unsigned short readyState;
  24. readonly attribute unsigned short status;
  25. readonly attribute ByteString statusText;
  26. readonly attribute DOMString responseText;
  27. readonly attribute any response;
  28. attribute XMLHttpRequestResponseType responseType;
  29. attribute unsigned long timeout;
  30. attribute boolean withCredentials;
  31. [SameObject] readonly attribute XMLHttpRequestUpload upload;
  32. undefined open(DOMString method, DOMString url);
  33. undefined open(ByteString method, USVString url, boolean async, optional USVString? username = null, optional USVString? password = null);
  34. undefined setRequestHeader(DOMString name, DOMString value);
  35. undefined send(optional (Document or XMLHttpRequestBodyInit)? body = null);
  36. undefined abort();
  37. ByteString? getResponseHeader(ByteString name);
  38. ByteString getAllResponseHeaders();
  39. undefined overrideMimeType(DOMString mime);
  40. attribute EventHandler onreadystatechange;
  41. };