XMLHttpRequest.hx 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright (C)2005-2017 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\XMLHttpRequest.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. `XMLHttpRequest` is an API that provides client functionality for transferring data between a client and a server. It provides an easy way to retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just a part of the page without disrupting what the user is doing.
  26. Documentation [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest>
  28. **/
  29. @:native("XMLHttpRequest")
  30. extern class XMLHttpRequest extends XMLHttpRequestEventTarget
  31. {
  32. static inline var UNSENT : Int = 0;
  33. static inline var OPENED : Int = 1;
  34. static inline var HEADERS_RECEIVED : Int = 2;
  35. static inline var LOADING : Int = 3;
  36. static inline var DONE : Int = 4;
  37. var onreadystatechange : haxe.Constraints.Function;
  38. var readyState(default,null) : Int;
  39. var timeout : Int;
  40. var withCredentials : Bool;
  41. var upload(default,null) : XMLHttpRequestUpload;
  42. var responseURL(default,null) : String;
  43. var status(default,null) : Int;
  44. var statusText(default,null) : String;
  45. var responseType : XMLHttpRequestResponseType;
  46. /**
  47. Returns an `ArrayBuffer`, `Blob`, `Document`, JavaScript object, or a `DOMString`, depending on the value of `XMLHttpRequest.responseType`. that contains the response entity body.
  48. **/
  49. var response(default,null) : Dynamic;
  50. var responseText(default,null) : String;
  51. var responseXML(default,null) : HTMLDocument;
  52. /** @throws DOMError */
  53. @:overload( function( ?params : Dynamic/*MISSING MozXMLHttpRequestParameters*/ ) : Void {} )
  54. function new( ignored : String ) : Void;
  55. /** @throws DOMError */
  56. @:overload( function( method : String, url : String ) : Void {} )
  57. /**
  58. Initializes a request. This method is to be used from JavaScript code; to initialize a request from native code, use `openRequest()` instead.
  59. **/
  60. function open( method : String, url : String, async : Bool, ?user : String, ?password : String ) : Void;
  61. /** @throws DOMError */
  62. /**
  63. Sets the value of an HTTP request header. You must call `setRequestHeader()`after `open()`, but before `send()`.
  64. **/
  65. function setRequestHeader( header : String, value : String ) : Void;
  66. /** @throws DOMError */
  67. @:overload( function() : Void {} )
  68. @:overload( function( data : ArrayBuffer ) : Void {} )
  69. @:overload( function( data : ArrayBufferView ) : Void {} )
  70. @:overload( function( data : Blob ) : Void {} )
  71. @:overload( function( data : HTMLDocument ) : Void {} )
  72. @:overload( function( data : String ) : Void {} )
  73. @:overload( function( data : FormData ) : Void {} )
  74. /**
  75. Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent.
  76. **/
  77. function send( data : Dynamic/*MISSING InputStream*/ ) : Void;
  78. /** @throws DOMError */
  79. /**
  80. Aborts the request if it has already been sent.
  81. **/
  82. function abort() : Void;
  83. /** @throws DOMError */
  84. /**
  85. Returns the string containing the text of the specified header, or `null` if either the response has not yet been received or the header doesn't exist in the response.
  86. **/
  87. function getResponseHeader( header : String ) : String;
  88. /** @throws DOMError */
  89. /**
  90. Returns all the response headers, separated by CRLF, as a string, or `null` if no response has been received.
  91. **/
  92. function getAllResponseHeaders() : String;
  93. /** @throws DOMError */
  94. /**
  95. Overrides the MIME type returned by the server.
  96. **/
  97. function overrideMimeType( mime : String ) : Void;
  98. }