soundcloud-api-ts - v1.13.4
    Preparing search index...

    Class RawClient

    Low-level HTTP client that returns raw responses without throwing on non-2xx status codes. Useful when you need access to status codes, headers, or want to handle errors manually.

    const raw = sc.raw;
    const res = await raw.get('/tracks/123456');
    console.log(res.status, res.headers, res.data);
    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • baseUrl: string
      • getToken: () => string | undefined
      • fetchFn: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        }
          • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
          • Parameters

            • input: URL | RequestInfo
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input: string | URL | Request, init?: RequestInit): Promise<Response>
          • Parameters

            • input: string | URL | Request
            • Optionalinit: RequestInit

            Returns Promise<Response>

      Returns RawClient

    Methods

    • GET shorthand

      Type Parameters

      • T = unknown

      Parameters

      • path: string
      • Optionalparams: Record<string, string | number | boolean | undefined>

      Returns Promise<RawResponse<T>>

    post

    • Make a raw HTTP request. Path template placeholders like {id} are substituted from matching keys in query before the remaining query params are appended to the URL as search parameters.

      Type Parameters

      • T = unknown

      Parameters

      • __namedParameters: {
            body?: unknown;
            method: string;
            path: string;
            query?: Record<string, string | number | boolean | undefined>;
            token?: string;
        }

      Returns Promise<RawResponse<T>>