• Executes a HTTP call (similiar to the Fetch API from the Web API)

    Parameters

    • url: string

      The URL to send the request to

    • options: HttpFetchOptions = ...

      Options to modify the behaviour of the HTTP call

    Returns HttpResponse

    Returns a HttpResponse instance for both fulfilled and rejected case with info about the HTTP call

    Example

    const response = httpFetch("https://swapi.dev/api/planets/1/");

    if (response.ok) {
    const data = response.bytes.toUtf8String();
    // Do something with data
    } else {
    // Error occured
    }