Function fetch

  • The global fetch() method starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response is available.

    Supported Protocols

    • http: - Fetch data from the network using the HTTP protocol
    • https: - Fetch data from the network using the HTTPS protocol
    • blob: - Fetch data from a URL constructed by URL.createObjectURL()
    • data: - Fetch data from a Data URI (possibly base64-encoded)
    • sdmc: - Fetch data from a local file on the SD card
    • romfs: - Fetch data from the RomFS partition of the nx.js application
    • file: - Same as sdmc:

    Parameters

    Returns Promise<Response>

    Example

    fetch('http://jsonip.com')
    .then(res => res.json())
    .then(data => {
    console.log(`Current IP address: ${data.ip}`);
    });

    See

    https://developer.mozilla.org/docs/Web/API/fetch

Generated using TypeDoc