@grabjs/superapp-sdk
    Preparing search index...

    Type Alias SendRequest

    SendRequest: {
        body?: unknown;
        endpoint: string;
        headers?: { [key: string]: string };
        method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
        query?: { [key: string]: string };
        timeout?: number;
    }

    Request parameters for sending a network request.

    Type Declaration

    • Optionalbody?: unknown
    • endpoint: string
    • Optionalheaders?: { [key: string]: string }
    • method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS"
    • Optionalquery?: { [key: string]: string }
    • Optionaltimeout?: number

    GET request with headers:

    {
    endpoint: 'https://api.example.com/users',
    method: 'GET',
    headers: { 'Authorization': 'Bearer token123' }
    }

    POST request with body:

    {
    endpoint: 'https://api.example.com/users',
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: { name: 'John Doe', email: 'john@example.com' }
    }

    Request with query parameters and timeout:

    {
    endpoint: 'https://api.example.com/search',
    method: 'GET',
    query: { q: 'grab', limit: '10' },
    timeout: 30
    }