Function execute_many

Source
pub fn execute_many(
    requests: BatchHttpRequest,
) -> Vec<Result<HttpResponse, HttpError>>
Expand description

Executes multiple HTTP requests in a batch and returns their results.

This function takes advantage of HttpClient::execute_many to handle multiple requests concurrently within the host runtime environment. Similar to executing single requests, this operation is blocking from the guest’s point of view but non-blocking on the host side where tasks can run asynchronously.

§Arguments

  • requests - A BatchHttpRequest containing a vector of individual crate::wit::HttpRequest objects. Each represents a complete HTTP request with its own settings and payload data to be sent.

§Returns

It returns a Vec<Result<HttpResponse, HttpError>>, which is a vector where each element corresponds to the result of executing one of the batched requests. Each element will either contain an HttpResponse if the request was successful or an HttpError if there was an issue with that particular request.