// This is based on `wasi:http@0.2.0` package wrpc:http@0.1.0; interface types { use wasi:http/types@0.2.0.{ error-code as wasi-error-code, method as wasi-method, request-options as wasi-request-options, scheme as wasi-scheme, }; use wasi:clocks/monotonic-clock@0.2.0.{duration}; type error-code = wasi-error-code; type method = wasi-method; type scheme = wasi-scheme; type fields = list>>>; record request-options { connect-timeout: option, first-byte-timeout: option, between-bytes-timeout: option, } record request { body: stream, trailers: future>, method: method, path-with-query: option, scheme: option, authority: option, headers: fields, } record response { body: stream, trailers: future>, status: u16, headers: fields, } } interface incoming-handler { use types.{request, response, error-code}; handle: func(request: request) -> result; } interface outgoing-handler { use types.{request, response, error-code, request-options}; handle: func(request: request, options: option) -> result; }