mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:42:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			55 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #import <DOM/Document.idl>
 | |
| #import <DOM/EventHandler.idl>
 | |
| #import <Fetch/BodyInit.idl>
 | |
| #import <XHR/XMLHttpRequestEventTarget.idl>
 | |
| #import <XHR/XMLHttpRequestUpload.idl>
 | |
| 
 | |
| enum XMLHttpRequestResponseType {
 | |
|     "",
 | |
|     "arraybuffer",
 | |
|     "blob",
 | |
|     "document",
 | |
|     "json",
 | |
|     "text"
 | |
| };
 | |
| 
 | |
| // https://xhr.spec.whatwg.org/#xmlhttprequest
 | |
| [Exposed=(Window,DedicatedWorker,SharedWorker)]
 | |
| interface XMLHttpRequest : XMLHttpRequestEventTarget {
 | |
| 
 | |
|     constructor();
 | |
| 
 | |
|     // event handler
 | |
|     attribute EventHandler onreadystatechange;
 | |
| 
 | |
|     // states
 | |
|     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;
 | |
| 
 | |
|     // request
 | |
|     undefined open(DOMString method, DOMString url);
 | |
|     undefined open(ByteString method, USVString url, boolean async, optional USVString? username = null, optional USVString? password = null);
 | |
|     undefined setRequestHeader(DOMString name, DOMString value);
 | |
|     attribute unsigned long timeout;
 | |
|     attribute boolean withCredentials;
 | |
|     [SameObject] readonly attribute XMLHttpRequestUpload upload;
 | |
|     undefined send(optional (Document or XMLHttpRequestBodyInit)? body = null);
 | |
|     undefined abort();
 | |
| 
 | |
|     // response
 | |
|     // FIXME: readonly attribute USVString responseURL;
 | |
|     readonly attribute unsigned short status;
 | |
|     readonly attribute ByteString statusText;
 | |
|     ByteString? getResponseHeader(ByteString name);
 | |
|     ByteString getAllResponseHeaders();
 | |
|     undefined overrideMimeType(DOMString mime);
 | |
|     attribute XMLHttpRequestResponseType responseType;
 | |
|     readonly attribute any response;
 | |
|     readonly attribute DOMString responseText;
 | |
|     readonly attribute Document? responseXML;
 | |
| 
 | |
| };
 | 
