@custouch/jssdk
    Preparing search index...

    Class FetchRequest

    Index

    Constructors

    • Parameters

      • Optionaloptions: {
            baseUrl?: string;
            headers?: HeadersInit;
            init?: RequestInit;
            interceptors?: Interceptors;
            timeout?: number;
            useDataWrapper?: boolean;
        }

      Returns FetchRequest

    Properties

    baseUrl?: string
    init: RequestInit = {}
    interceptors?: Interceptors

    拦截器

    timeout?: number = 10000
    useDataWrapper: boolean = true

    是否对结果进行序列话后返回

    Methods

    • Parameters

      • route: string
      • Optionaldata: string | any[] | Record<string, any>
      • Optionaloptions: RequestOptions

      Returns Promise<any>

    • Parameters

      • route: string
      • options: RequestInit & { responseType?: "text" | "json" | "blob" | "arrayBuffer" } & {
            params?: null | Record<string, any>;
        } & { data?: any }

      Returns Promise<any>

    • Parameters

      • route: string
      • Optionaloptions: RequestOptions

      Returns Promise<any>

    • Parameters

      • rsp: Response
      • options: RequestOptions

      Returns Promise<any>

    • Parameters

      • rsp: Response
      • options: RequestOptions

      Returns Promise<any> | Response

    • Parameters

      • Optionalheaders: HeadersInit

      Returns HeadersInit

    • Parameters

      • route: string

      Returns string

    post

    • post(
          route: string,
          data?: string | any[] | Record<string, any>,
          options?: RequestOptions,
      ): Promise<any>

      Parameters

      • route: string
      • Optionaldata: string | any[] | Record<string, any>
      • Optionaloptions: RequestOptions

      Returns Promise<any>

    • Parameters

      • route: string
      • Optionaldata: string | any[] | Record<string, any>
      • Optionaloptions: RequestOptions

      Returns Promise<any>

    • Returns undefined | AbortSignal