For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-native-api/lynx-generic-resource-fetcher/fetch-resource.md.
Lynx
  • English
  • fetchResource

    LynxEngine internally calls this method to obtain the general resource content, and the return result is required to be the resource content byte[] type.

    Syntax

    Android

    public abstract void fetchResource(
        LynxResourceRequest request, LynxResourceCallback<byte[]> callback);

    Parameters

    • request: Request for the requiring resource.
    • callback: Contents of the requiring resource.
    Note
    • This method must be implemented.

    iOS

    - (dispatch_block_t)fetchResource:(nonnull LynxResourceRequest *)request
                           onComplete:(LynxGenericResourceCompletionBlock _Nonnull)callback;

    Parameters

    • request: Request for the requiring resource.
    • callback: Contents of the requiring resource.
    Note
    • This method must be implemented.

    Harmony

    abstract fetchResource(request: LynxResourceRequest, callback: AsyncCallback<ArrayBuffer>): void;

    Parameters

    • request: Request to obtain the general resource content.
    • callback: Containing contents of the requiring resource.

    Desktop (C++)

    virtual void FetchResource(std::shared_ptr<lynx::pub::LynxResourceRequest> request,
                               std::shared_ptr<lynx::pub::LynxResourceResponse> response);

    Parameters

    • request: Request for the resource being fetched.
    • response: Response object to be populated by the host.

    Compatibility

    LCD tables only load in the browser

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.