From 55a475447afc0f2e2c38fb587faa2cc063fd02ce Mon Sep 17 00:00:00 2001
From: "Adam C. Foltzer" Gives the Gives the incoming-request is drop
+headers>
+[method]incoming-request.take-headers: funcheaders associated with this request as an owned resource.
+Will only return success at most once, and subsequent calls will return
+error.Params
+
+
+self: borrow<incoming-request>Return values
+
+
headers>>[method]incoming-request.consume: funcincoming-body associated with this request. Will only
return success at most once, and subsequent calls will return error.
[method]incoming-response.consume: funcReturns the incoming body. May be called at most once. Returns error if called additional times.
+Deprecated in favor of into-parts.
self: borrow<incoming-response>incoming-body>>[method]incoming-response.take-headers: funcReturns the headers associated with this response as an owned
+resource. Will only return success at most once, and subsequent calls
+will return error.
self: borrow<incoming-response>headers>>[method]incoming-body.stream: funcReturns the contents of the body, as a stream of bytes.
Returns success on first call: the stream representing the contents
diff --git a/proxy.md b/proxy.md
index b3945ad..55a98b0 100644
--- a/proxy.md
+++ b/proxy.md
@@ -906,6 +906,18 @@ the parent incoming-request is drop
headers>[method]incoming-request.take-headers: funcGives the headers associated with this request as an owned resource.
+Will only return success at most once, and subsequent calls will return
+error.
self: borrow<incoming-request>headers>>[method]incoming-request.consume: funcGives the incoming-body associated with this request. Will only
return success at most once, and subsequent calls will return error.
[method]incoming-response.consume: funcReturns the incoming body. May be called at most once. Returns error if called additional times.
+Deprecated in favor of into-parts.
self: borrow<incoming-response>incoming-body>>[method]incoming-response.take-headers: funcReturns the headers associated with this response as an owned
+resource. Will only return success at most once, and subsequent calls
+will return error.
self: borrow<incoming-response>headers>>[method]incoming-body.stream: funcReturns the contents of the body, as a stream of bytes.
Returns success on first call: the stream representing the contents
diff --git a/wit/types.wit b/wit/types.wit
index 755ac6a..f546c57 100644
--- a/wit/types.wit
+++ b/wit/types.wit
@@ -242,6 +242,11 @@ interface types {
/// `incoming-request` before all children are dropped will trap.
headers: func() -> headers;
+ /// Gives the `headers` associated with this request as an owned resource.
+ /// Will only return success at most once, and subsequent calls will return
+ /// error.
+ take-headers: func() -> result
[method]incoming-response.consume: funcReturns the incoming body. May be called at most once. Returns error if called additional times.
-Deprecated in favor of into-parts.
self: borrow<incoming-response>[method]incoming-response.consume: funcReturns the incoming body. May be called at most once. Returns error if called additional times.
-Deprecated in favor of into-parts.
self: borrow<incoming-response>included in other worlds.
wasi:cli/stderr@0.2.0wasi:cli/stdin@0.2.0wasi:clocks/monotonic-clock@0.2.0wasi:http/types@0.2.0wasi:http/outgoing-handler@0.2.0wasi:http/types@0.2.1-draftwasi:http/outgoing-handler@0.2.1-draftwasi:clocks/wall-clock@0.2.0pollable>This interface defines all of the types and methods for implementing HTTP Requests and Responses, both incoming and outgoing, as well as their headers, trailers, and bodies.
@@ -1471,7 +1471,7 @@ but those will be reported by theincoming-body
- option<result<result<own<
incoming-response
>, error-code>>>
This interface defines a handler of outgoing HTTP Requests. It should be imported by components which wish to make HTTP Requests.
wasi:clocks/monotonic-clock@0.2.0wasi:io/error@0.2.0wasi:io/streams@0.2.0wasi:http/types@0.2.0wasi:http/types@0.2.1-draftwasi:random/random@0.2.0wasi:cli/stdout@0.2.0wasi:cli/stderr@0.2.0wasi:cli/stdin@0.2.0wasi:http/outgoing-handler@0.2.0wasi:http/outgoing-handler@0.2.1-draftwasi:clocks/wall-clock@0.2.0wasi:http/incoming-handler@0.2.0wasi:http/incoming-handler@0.2.1-draftsplice.
u64, stream-error>This interface defines all of the types and methods for implementing HTTP Requests and Responses, both incoming and outgoing, as well as their headers, trailers, and bodies.
@@ -1478,7 +1478,7 @@ represented as au64.
input-stream>This interface defines a handler of outgoing HTTP Requests. It should be imported by components which wish to make HTTP Requests.
type incoming-request