• Sends a GET request to a specified URL with optional parameters and Bearer Token. Content-Type is set to application/json.

    Parameters

    • url: string

      The URL to send the GET request to.

    • Optional params: any

      Optional query parameters to be appended to the URL.

      Optional
    • Optional token: string

      Optional token to be included in the Authorization header.

      Optional

    Returns Promise<Response>

    The response from the GET request.

    Example

    const response = await sendGet('https://api.example.com/data', { q: 'searchTerm' }, 'mytoken123');
    const data = await response.json();
    console.log(data);

    Throws

    Will throw an error if the GET request fails.

Generated using TypeDoc