5 <title>JSDoc: Class: XHR</title>
7 <script src="scripts/prettify/prettify.js"> </script>
8 <script src="scripts/prettify/lang-css.js"> </script>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
20 <h1 class="page-title">Class: XHR</h1>
31 <h2><span class="attribs"><span class="type-signature"></span></span>
32 <span class="ancestors"><a href="LuCI.html">LuCI</a>.</span>XHR<span class="signature">()</span><span class="type-signature"></span></h2>
34 <div class="class-description"><p>The <code>LuCI.XHR</code> class is a legacy compatibility shim for the
35 functionality formerly provided by <code>xhr.js</code>. It is registered as global
36 <code>window.XHR</code> symbol for compatibility with legacy code.</p>
37 <p>New code should use <a href="LuCI.Request.html"><code>LuCI.Request</code></a> instead to implement HTTP
38 request handling.</p></div>
44 <div class="container-overview">
53 <h4 class="name" id="XHR"><span class="type-signature"></span>new XHR<span class="signature">()</span><span class="type-signature"></span></h4>
89 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
101 <dt class="tag-source">Source:</dt>
102 <dd class="tag-source"><ul class="dummy"><li>
103 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line2943">line 2943</a>
151 <h3 class="subsection-title">Methods</h3>
159 <h4 class="name" id="abort"><span class="type-signature"></span>abort<span class="signature">()</span><span class="type-signature"></span></h4>
166 <div class="description">
167 <p>Ignored for backwards compatibility.</p>
168 <p>This function does nothing.</p>
200 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
212 <dt class="tag-source">Source:</dt>
213 <dd class="tag-source"><ul class="dummy"><li>
214 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line3046">line 3046</a>
250 <h4 class="name" id="busy"><span class="type-signature"></span>busy<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
257 <div class="description">
258 <p>Checks the running state of the request.</p>
290 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
302 <dt class="tag-source">Source:</dt>
303 <dd class="tag-source"><ul class="dummy"><li>
304 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line3035">line 3035</a>
332 <div class="param-desc">
333 <p>Returns <code>true</code> if the request is still running or <code>false</code> if it
334 already completed.</p>
345 <span class="param-type">boolean</span>
363 <h4 class="name" id="cancel"><span class="type-signature"></span>cancel<span class="signature">()</span><span class="type-signature"></span></h4>
370 <div class="description">
371 <p>Cancels a running request.</p>
372 <p>This function does not actually cancel the underlying
373 <code>XMLHTTPRequest</code> request but it sets a flag which prevents the
374 invocation of the callback function when the request eventually
375 finishes or timed out.</p>
407 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
419 <dt class="tag-source">Source:</dt>
420 <dd class="tag-source"><ul class="dummy"><li>
421 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line3022">line 3022</a>
457 <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(url, data<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>, timeout<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<null>}</span></h4>
464 <div class="description">
465 <p>This function is a legacy wrapper around
466 <a href="LuCI.html#get"><code>LuCI.get()</code></a>.</p>
480 <table class="params">
495 <th class="last">Description</th>
504 <td class="name"><code>url</code></td>
510 <span class="param-type">string</span>
517 <td class="attributes">
528 <td class="description last"><p>The URL to request</p></td>
535 <td class="name"><code>data</code></td>
541 <span class="param-type">Object</span>
548 <td class="attributes">
561 <td class="description last"><p>Additional query string data</p></td>
568 <td class="name"><code>callback</code></td>
574 <span class="param-type"><a href="LuCI.html#.requestCallbackFn">LuCI.requestCallbackFn</a></span>
581 <td class="attributes">
594 <td class="description last"><p>Callback function to invoke on completion</p></td>
601 <td class="name"><code>timeout</code></td>
607 <span class="param-type">number</span>
614 <td class="attributes">
627 <td class="description last"><p>Request timeout to use</p></td>
656 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
668 <dt class="tag-source">Source:</dt>
669 <dd class="tag-source"><ul class="dummy"><li>
670 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line2978">line 2978</a>
706 <span class="param-type">Promise.<null></span>
724 <h4 class="name" id="post"><span class="type-signature"></span>post<span class="signature">(url, data<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>, timeout<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<null>}</span></h4>
731 <div class="description">
732 <p>This function is a legacy wrapper around
733 <a href="LuCI.html#post"><code>LuCI.post()</code></a>.</p>
747 <table class="params">
762 <th class="last">Description</th>
771 <td class="name"><code>url</code></td>
777 <span class="param-type">string</span>
784 <td class="attributes">
795 <td class="description last"><p>The URL to request</p></td>
802 <td class="name"><code>data</code></td>
808 <span class="param-type">Object</span>
815 <td class="attributes">
828 <td class="description last"><p>Additional data to append to the request body.</p></td>
835 <td class="name"><code>callback</code></td>
841 <span class="param-type"><a href="LuCI.html#.requestCallbackFn">LuCI.requestCallbackFn</a></span>
848 <td class="attributes">
861 <td class="description last"><p>Callback function to invoke on completion</p></td>
868 <td class="name"><code>timeout</code></td>
874 <span class="param-type">number</span>
881 <td class="attributes">
894 <td class="description last"><p>Request timeout to use</p></td>
923 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
935 <dt class="tag-source">Source:</dt>
936 <dd class="tag-source"><ul class="dummy"><li>
937 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line3005">line 3005</a>
973 <span class="param-type">Promise.<null></span>
991 <h4 class="name" id="send_form"><span class="type-signature"></span>send_form<span class="signature">()</span><span class="type-signature"></span></h4>
998 <div class="description">
999 <p>Existing for backwards compatibility.</p>
1000 <p>This function simply throws an <code>InternalError</code> when invoked.</p>
1015 <dl class="details">
1032 <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
1044 <dt class="tag-source">Source:</dt>
1045 <dd class="tag-source"><ul class="dummy"><li>
1046 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line3061">line 3061</a>
1075 <div class="param-desc">
1076 <p>Throws an <code>InternalError</code> with the message <code>Not implemented</code>
1088 <span class="param-type">InternalError</span>
1122 <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="LuCI.html">LuCI</a></li><li><a href="LuCI.Class.html">Class</a></li><li><a href="LuCI.dom.html">dom</a></li><li><a href="LuCI.fs.html">fs</a></li><li><a href="LuCI.Headers.html">Headers</a></li><li><a href="LuCI.Network.html">Network</a></li><li><a href="LuCI.Network.Device.html">Device</a></li><li><a href="LuCI.Network.Hosts.html">Hosts</a></li><li><a href="LuCI.Network.Protocol.html">Protocol</a></li><li><a href="LuCI.Network.WifiDevice.html">WifiDevice</a></li><li><a href="LuCI.Network.WifiNetwork.html">WifiNetwork</a></li><li><a href="LuCI.Poll.html">Poll</a></li><li><a href="LuCI.Request.html">Request</a></li><li><a href="LuCI.Request.poll.html">poll</a></li><li><a href="LuCI.Response.html">Response</a></li><li><a href="LuCI.rpc.html">rpc</a></li><li><a href="LuCI.uci.html">uci</a></li><li><a href="LuCI.view.html">view</a></li><li><a href="LuCI.XHR.html">XHR</a></li></ul>
1128 Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time)
1131 <script> prettyPrint(); </script>
1132 <script src="scripts/linenumber.js"> </script>