Pebble App Framework: Phone API
    Preparing search index...

    Function request

    • Fetches a URL with an HTTP GET and reports the result through a callback rather than a promise, since that is what the fetch layer expects everywhere else.

      A 2xx answers null and the body, and any other status http <status> and the body. A request that times out answers timeout, and one whose error event fires answers FETCH_FAILED, since it may have reached the provider. Only a request that threw before it went out answers NETWORK_ERROR.

      Parameters

      • url: string

        The URL to fetch.

      • callback: (err: string | null, body?: string) => void

        Called once with an error, or with null and the response body on success.

      Returns void