http-client.wit

 1interface http-client {
 2    /// An HTTP request.
 3    record http-request {
 4        /// The URL to which the request should be made.
 5        url: string,
 6    }
 7
 8    /// An HTTP response.
 9    record http-response {
10        /// The response body.
11        body: string,
12    }
13
14    /// Performs an HTTP request and returns the response.
15    fetch: func(req: http-request) -> result<http-response, string>;
16}