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.

    • 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:


    Returns Promise<Response>

    .then(res => res.json())
    .then(data => {
    console.log(`Current IP address: ${data.ip}`);