Class: $.BulkDownloadRequestDelegate

Inherits:
Toybox.Lang.Object show all

Overview

Helper class makes a web or image request with context data.

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var _callback as Lang.Method(code as Lang.Number) as Void

Instance Method Details

initialize(callback as Lang.Method(code as Lang.Number) as Void)

Constructor

Parameters:

  • callback —

    The method to invoke when the request completes.

makeImageRequest(url as Lang.String, params as Lang.Dictionary or Null, options as { :palette as Lang.Array<Lang.Number>, :maxWidth as Lang.Number, :maxHeight as Lang.Number, :dithering as Communications.Dithering }) as Void

Make an image request using the given options.

Parameters:

  • url —

    The URL of an image to request

  • params —

    Items to append to the URL

  • options —

    Additional image options

    • :palette —

      The color palette to restrict the image dithering to

    • :maxWidth —

      The maximum width an image should be scaled to

    • :maxHeight —

      The maximum height an image should be scaled to

    • :dithering —

      The type of dithering to use when processing the image

makeWebRequest(url as Lang.String, params as Lang.Dictionary<Lang.Object, Lang.Object> or Null, options as { :method as Communications.HttpRequestMethod, :headers as Lang.Dictionary, :responseType as Communications.HttpResponseContentType, :context as Lang.Object or Null, :maxBandwidth as Lang.Number, :fileDownloadProgressCallback as Lang.Method(totalBytesTransferred as Lang.Number, fileSize as Lang.Number or Null) as Void } or Null) as Void

Make a web request using the given options.

Parameters:

  • url —

    The URL to load in the web view to begin authentication

  • params —

    Items to append to the URL as a GET request or set as the body for a POST request

  • options —

    Additional web request options

    • :method —

      The HTTP method of the request

    • :headers —

      A Dictionary of HTTP headers to include in the request

    • :responseType —

      The format of the response

    • :context —

      A user-specific context object to pass to the response callback

    • :maxBandwidth —

      The maximum bandwidth

    • :fileDownloadProgressCallback —

      A callback method

onImageResponse(code as Lang.Number, data as WatchUi.BitmapResource or Graphics.BitmapReference or Null) as Void

Handle completed image request

Parameters:

  • code —

    The server response code or BLE error

  • data —

    A bitmap from a successful request

onWebResponse(code as Lang.Number, data as Lang.Dictionary or Lang.String or Null) as Void

Handle completed web request

Parameters:

  • code —

    The server response code or BLE error

  • data —

    Content from a successful request


Generated Jun 9, 2026, 8:45:35 AM