Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 510125 of net/url

  • Revision slug: Mozilla/Add-ons/SDK/Low-Level_APIs/net_url
  • Revision title: net/url
  • Revision id: 510125
  • Created:
  • Creator: wbamberg
  • Is current revision? No
  • Comment

Revision Content

Experimental

Enables you to read content from a URI.

Globals

Functions

readURI(uri, options)

Reads a URI and returns a promise.

Parameters

uri : string
The URL, as a string, to load.

options : object
Optional options:

Name Type  
sync boolean

If this option is set to true, the promise returned will be resolved synchronously. Defaults to false if not provided.

charset string

The character set to use when read the content of the uri given. Defaults to UTF-8 if not provided.

Returns

promise : The promise that will be resolved with the content of the URL given.

Revision Source

<div class="note">
 <p>Experimental</p>
</div>
<p>Enables you to read content from a URI.</p>
<h2 id="Globals">Globals</h2>
<h3 id="Functions">Functions</h3>
<h4 class="addon-sdk-api-name" id="readURI(uri.2C_options)"><code>readURI(uri, options)</code></h4>
<p>Reads a URI and returns a <a href="/en-US/Add-ons/SDK/Low-Level_APIs/core_promise">promise</a>.</p>
<h5 id="Parameters">Parameters</h5>
<p><strong>uri : string</strong><br />
 The URL, as a string, to load.</p>
<p><strong>options : object</strong><br />
 Optional options:</p>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Name</th>
   <th scope="col">Type</th>
   <th scope="col">&nbsp;</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>sync</td>
   <td>boolean</td>
   <td>
    <p>If this option is set to <code>true</code>, the promise returned will be resolved synchronously. Defaults to <code>false</code> if not provided.</p>
   </td>
  </tr>
  <tr>
   <td>charset</td>
   <td>string</td>
   <td>
    <p>The character set to use when read the content of the <code>uri</code> given. Defaults to <code>UTF-8</code> if not provided.</p>
   </td>
  </tr>
 </tbody>
</table>
<h5 id="Returns">Returns</h5>
<p><strong>promise</strong> : The promise that will be resolved with the content of the URL given.</p>
Revert to this revision