interface http-client { /// An HTTP request. record http-request { /// The HTTP method for the request. method: http-method, /// The URL to which the request should be made. url: string, /// Headers for the request. headers: list>, /// The request body. body: option>, } /// HTTP methods. enum http-method { get, post, put, delete, head, options, patch, } /// An HTTP response. record http-response { /// The response headers. headers: list>, /// The response body. body: list, } /// Performs an HTTP request and returns the response. fetch: func(req: http-request) -> result; /// An HTTP response stream. resource http-response-stream { /// Retrieves the next chunk of data from the response stream. /// Returns None if the stream has ended. next-chunk: func() -> result>, string>; } /// Performs an HTTP request and returns a response stream. fetch-stream: func(req: http-request) -> result; }