5 <title>JSDoc: Class: Response</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: Response</h1>
31 <h2><span class="attribs"><span class="type-signature"></span></span>
32 <span class="ancestors"><a href="LuCI.html">LuCI</a>.</span>Response</h2>
34 <div class="class-description"><p>The <code>Response</code> class is an internal utility class representing HTTP responses.</p></div>
40 <div class="container-overview">
85 <dt class="tag-source">Source:</dt>
86 <dd class="tag-source"><ul class="dummy"><li>
87 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line377">line 377</a>
133 <h3 class="subsection-title">Members</h3>
137 <h4 class="name" id="duration"><span class="type-signature"></span>duration<span class="type-signature"> :number</span></h4>
142 <div class="description">
143 <p>The total duration of the HTTP request in milliseconds</p>
152 <span class="param-type">number</span>
189 <dt class="tag-source">Source:</dt>
190 <dd class="tag-source"><ul class="dummy"><li>
191 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line416">line 416</a>
209 <h4 class="name" id="headers"><span class="type-signature"></span>headers<span class="type-signature"> :<a href="LuCI.Headers.html">LuCI.Headers</a></span></h4>
214 <div class="description">
215 <p>The HTTP headers of the response</p>
224 <span class="param-type"><a href="LuCI.Headers.html">LuCI.Headers</a></span>
261 <dt class="tag-source">Source:</dt>
262 <dd class="tag-source"><ul class="dummy"><li>
263 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line407">line 407</a>
281 <h4 class="name" id="ok"><span class="type-signature"></span>ok<span class="type-signature"> :boolean</span></h4>
286 <div class="description">
287 <p>Describes whether the response is successful (status codes <code>200..299</code>) or not</p>
296 <span class="param-type">boolean</span>
333 <dt class="tag-source">Source:</dt>
334 <dd class="tag-source"><ul class="dummy"><li>
335 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line380">line 380</a>
353 <h4 class="name" id="status"><span class="type-signature"></span>status<span class="type-signature"> :number</span></h4>
358 <div class="description">
359 <p>The numeric HTTP status code of the response</p>
368 <span class="param-type">number</span>
405 <dt class="tag-source">Source:</dt>
406 <dd class="tag-source"><ul class="dummy"><li>
407 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line389">line 389</a>
425 <h4 class="name" id="statusText"><span class="type-signature"></span>statusText<span class="type-signature"> :string</span></h4>
430 <div class="description">
431 <p>The HTTP status description message of the response</p>
440 <span class="param-type">string</span>
477 <dt class="tag-source">Source:</dt>
478 <dd class="tag-source"><ul class="dummy"><li>
479 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line398">line 398</a>
497 <h4 class="name" id="url"><span class="type-signature"></span>url<span class="type-signature"> :string</span></h4>
502 <div class="description">
503 <p>The final URL of the request, i.e. after following redirects.</p>
512 <span class="param-type">string</span>
549 <dt class="tag-source">Source:</dt>
550 <dd class="tag-source"><ul class="dummy"><li>
551 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line425">line 425</a>
571 <h3 class="subsection-title">Methods</h3>
579 <h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">(content<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="LuCI.Response.html">LuCI.Response</a>}</span></h4>
586 <div class="description">
587 <p>Clones the given response object, optionally overriding the content
588 of the cloned instance.</p>
602 <table class="params">
617 <th class="last">Description</th>
626 <td class="name"><code>content</code></td>
632 <span class="param-type">*</span>
639 <td class="attributes">
652 <td class="description last"><p>Override the content of the cloned response. Object values will be
653 treated as JSON response data, all other types will be converted
654 using <code>String()</code> and treated as response text.</p></td>
693 <dt class="tag-source">Source:</dt>
694 <dd class="tag-source"><ul class="dummy"><li>
695 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line465">line 465</a>
723 <div class="param-desc">
724 <p>The cloned <code>Response</code> instance.</p>
735 <span class="param-type"><a href="LuCI.Response.html">LuCI.Response</a></span>
753 <h4 class="name" id="json"><span class="type-signature"></span>json<span class="signature">()</span><span class="type-signature"> → {*}</span></h4>
760 <div class="description">
761 <p>Access the response content as JSON data.</p>
803 <dt class="tag-source">Source:</dt>
804 <dd class="tag-source"><ul class="dummy"><li>
805 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line486">line 486</a>
834 <div class="param-desc">
835 <p>Throws <code>SyntaxError</code> if the content isn't valid JSON.</p>
846 <span class="param-type">SyntaxError</span>
862 <div class="param-desc">
863 <p>The parsed JSON data.</p>
874 <span class="param-type">*</span>
892 <h4 class="name" id="text"><span class="type-signature"></span>text<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
899 <div class="description">
900 <p>Access the response content as string.</p>
942 <dt class="tag-source">Source:</dt>
943 <dd class="tag-source"><ul class="dummy"><li>
944 <a href="luci.js.html">luci.js</a>, <a href="luci.js.html#line501">line 501</a>
972 <div class="param-desc">
973 <p>The response content.</p>
984 <span class="param-type">string</span>
1012 <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>
1018 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)
1021 <script> prettyPrint(); </script>
1022 <script src="scripts/linenumber.js"> </script>