Skip to content

Add wasi:http support to the C API#12950

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
chaynabors:add-wasi-http-c-api
Apr 3, 2026
Merged

Add wasi:http support to the C API#12950
alexcrichton merged 1 commit intobytecodealliance:mainfrom
chaynabors:add-wasi-http-c-api

Conversation

@chaynabors
Copy link
Copy Markdown
Contributor

@chaynabors chaynabors commented Apr 3, 2026

Closes #12943 as requested.

Adds wasi:http support to the C API following the same pattern as wasip2. The wasi-http feature implies wasi and is enabled by default.

New C API functions:

  • wasmtime_component_linker_add_wasi_http
  • wasmtime_context_set_wasi_http

It would be possible to construct WasiHttpCtx::new() directly, but I kept it optional and enabled consumers of the API to pass their own in the event that the WasiHttpCtx type becomes more configurable. Something that I think would be pretty reasonable.

@chaynabors chaynabors force-pushed the add-wasi-http-c-api branch from cc13e94 to 14c3fb1 Compare April 3, 2026 15:21
@chaynabors chaynabors force-pushed the add-wasi-http-c-api branch from 14c3fb1 to a8583a7 Compare April 3, 2026 15:25
@chaynabors chaynabors marked this pull request as ready for review April 3, 2026 15:53
@chaynabors chaynabors requested review from a team as code owners April 3, 2026 15:53
@chaynabors chaynabors requested review from alexcrichton and removed request for a team April 3, 2026 15:53
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@alexcrichton alexcrichton added this pull request to the merge queue Apr 3, 2026
Merged via the queue into bytecodealliance:main with commit e430575 Apr 3, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

c-api: Add wasi:http support

2 participants