Fetch Client API Documentation - v1.1.1
    Preparing search index...

    Variable CONTENT_TYPESConst Readonly

    CONTENT_TYPES: { JSON: "json"; TEXT: readonly ["text/", "xml"]; BINARY: RegExp } = ...

    Content type patterns for response parsing

    Type Declaration

    • ReadonlyJSON: "json"

      JSON content type pattern for parsing

    • ReadonlyTEXT: readonly ["text/", "xml"]

      Text content type patterns (includes XML)

    • ReadonlyBINARY: RegExp

      Binary content type patterns (images, videos, etc.)

    Patterns used to determine how to parse response data based on the Content-Type header.

    // Check content type for parsing
    if (contentType.includes(CONTENT_TYPES.JSON)) {
    return response.json();
    }

    // Check if binary content
    if (CONTENT_TYPES.BINARY.test(contentType)) {
    return response.blob();
    }