NetWasm.System.Net.Http
0.13.0-preview.1
Prefix Reserved
See the version list below for details.
dotnet add package NetWasm.System.Net.Http --version 0.13.0-preview.1
NuGet\Install-Package NetWasm.System.Net.Http -Version 0.13.0-preview.1
<PackageReference Include="NetWasm.System.Net.Http" Version="0.13.0-preview.1" />
<PackageVersion Include="NetWasm.System.Net.Http" Version="0.13.0-preview.1" />
<PackageReference Include="NetWasm.System.Net.Http" />
paket add NetWasm.System.Net.Http --version 0.13.0-preview.1
#r "nuget: NetWasm.System.Net.Http, 0.13.0-preview.1"
#:package NetWasm.System.Net.Http@0.13.0-preview.1
#addin nuget:?package=NetWasm.System.Net.Http&version=0.13.0-preview.1&prerelease
#tool nuget:?package=NetWasm.System.Net.Http&version=0.13.0-preview.1&prerelease
NetWasm.System.Net.Http
NetWasm.System.Net.Http supplies the System.Net.Http assembly for the
netwasm0.1 profile: upstream .NET's HttpClient, HttpRequestMessage,
HttpResponseMessage and content types over WASI 0.3's wasi:http.
The package carries the NetWasm,Version=v0.1 asset and preserves the public
System.Net.Http assembly identity. It does not add a JavaScript HTTP fallback
or replace desktop .NET's built-in System.Net.Http reference.
Outgoing requests
HttpClient sends requests through the host's wasi:http client. Wasmtime,
Spin, wasmCloud and NetWasm's Node.js and browser hosts provide it; a command
run with wasmtime run needs -Shttp.
HTTP services
A project with <OutputType>Component</OutputType> and
<NetWasmWorld>service</NetWasmWorld> that references this package is a
wasi:http service. Implement one method in the project's root namespace (or
in NetWasmHttpServiceNamespace):
public static partial class ServiceExports
{
public static async partial Task<HttpResponseMessage> Handle(HttpRequestMessage request)
{
var body = await request.Content!.ReadAsStringAsync();
return new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent($"{request.Method} {request.RequestUri!.PathAndQuery} [{body}]"),
};
}
}
The package generates the wasi:http handler that turns each request into an
HttpRequestMessage, calls Handle, and streams the HttpResponseMessage
back with its status, headers and content. An exception from Handle answers
with wasi:http's internal error, which hosts send as a 500. Handle can use
HttpClient to call other services.
dotnet publish writes one component that wasmtime serve -Sp3 -Scli, Spin
and wasmCloud run unchanged. Node.js cannot serve WASI 0.3 HTTP components
yet.
Learn more about Target Frameworks and .NET Standard.
-
Unsupported 0.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NetWasm.System.Net.Http:
| Package | Downloads |
|---|---|
|
NetWasm.System.Net.Http.Json
NetWasm netwasm0.1 metadata-first System.Net.Http.Json. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.13.0 | 106 | 11/13/2026 |
| 0.13.0-preview.1 | 55 | 11/13/2026 |
| 0.12.1 | 138 | 11/10/2026 |
| 0.12.1-preview.1 | 55 | 11/10/2026 |
| 0.12.0 | 83 | 11/10/2026 |
| 0.12.0-preview.1 | 56 | 11/10/2026 |
| 0.11.0 | 107 | 11/6/2026 |
| 0.11.0-preview.1 | 54 | 11/6/2026 |
| 0.10.8 | 99 | 11/4/2026 |
| 0.10.8-preview.1 | 55 | 11/4/2026 |
| 0.10.7 | 112 | 11/2/2026 |
| 0.10.7-preview.1 | 57 | 11/2/2026 |
| 0.10.0 | 136 | 10/21/2026 |
| 0.10.0-preview.1 | 67 | 10/21/2026 |
| 0.9.0 | 111 | 10/20/2026 |
| 0.9.0-preview.1 | 61 | 10/20/2026 |
| 0.8.0 | 98 | 10/16/2026 |
| 0.8.0-preview.1 | 57 | 10/16/2026 |
| 0.7.0 | 141 | 10/6/2026 |
| 0.7.0-preview.1 | 78 | 10/6/2026 |