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: func
headers
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: func
incoming-body
associated with this request. Will only
return success at most once, and subsequent calls will return error.
[method]incoming-response.consume: func
Returns 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: func
Returns 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: func
Returns 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: func
Gives 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: func
Gives the incoming-body
associated with this request. Will only
return success at most once, and subsequent calls will return error.
[method]incoming-response.consume: func
Returns 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: func
Returns 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: func
Returns 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: func
Returns 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: func
Returns 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
>include
d in other worlds.
wasi:cli/stderr@0.2.0
wasi:cli/stdin@0.2.0
wasi:clocks/monotonic-clock@0.2.0
wasi:http/types@0.2.0
wasi:http/outgoing-handler@0.2.0
wasi:http/types@0.2.1-draft
wasi:http/outgoing-handler@0.2.1-draft
wasi:clocks/wall-clock@0.2.0
pollable
>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.0
wasi:io/error@0.2.0
wasi:io/streams@0.2.0
wasi:http/types@0.2.0
wasi:http/types@0.2.1-draft
wasi:random/random@0.2.0
wasi:cli/stdout@0.2.0
wasi:cli/stderr@0.2.0
wasi:cli/stdin@0.2.0
wasi:http/outgoing-handler@0.2.0
wasi:http/outgoing-handler@0.2.1-draft
wasi:clocks/wall-clock@0.2.0
wasi:http/incoming-handler@0.2.0
wasi:http/incoming-handler@0.2.1-draft
splice
.
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