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-api/global/fetch.md.
Lynx
  • English
  • fetch BTS

    Syntax

    fetch(resource);
    fetch(resource, options);

    Parameters

    resource

    This defines the resource that you wish to fetch. This can either be:

    • A string or any other object with stringify API — including a URL object — that provides the URL of the resource you want to fetch.

    • A Request object.

    options

    A RequestInit object containing any custom settings that you want to apply to the request.

    Example

    const request = new Request('https://jsonplaceholder.typicode.com/todos/1');
    const response = await fetch(request);
    console.log(await response.json());

    Compatibility

    Info
    • Client environment are different from Web, Lynx does not support Web-only features like: CORS、redirect、keepalive related APIs. FormData/Blob related APIs are not supported.

    • Web Platform supports Fetch API using Browser's Fetch implementation, it follows the same rules as the web.

    LCD tables only load in the browser

    Headers

    LCD tables only load in the browser

    Request

    LCD tables only load in the browser

    Response

    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.