Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions components/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ crate-type = ["cdylib"]
[dependencies]
url = "2.5"
wit-bindgen = { workspace = true, features = ["async-spawn"] }

[dev-dependencies]
test-harness = { workspace = true }
tokio = { workspace = true }
wasmtime = { workspace = true }
6 changes: 6 additions & 0 deletions components/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ A higher-level HTTP client that delegates to wasi:http/client.
- `trace(url, headers, options)`
- `query(url, headers, body, options)`

## Redirects

Redirects are followed, up to 10 unless `max-redirects` is set in the request options.

The request body is streamed, so it can't be sent again. A redirect that sends the body again returns a `redirect-requires-body` error with the redirect response, and the method, url, headers and options for the next request, send it with the body to follow the redirect. The body is sent again for a request with a body when the redirect keeps the method, a 307 or 308, or a 301 or 302 for a method other than POST. A 303, or a 301 or 302 for POST, switches to GET without the body, and is followed.

## The `client` World

- exports `componentized:http/client`
Expand Down
Loading
Loading