HttpMultipart 0.1.4
dotnet add package HttpMultipart --version 0.1.4
NuGet\Install-Package HttpMultipart -Version 0.1.4
<PackageReference Include="HttpMultipart" Version="0.1.4"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="HttpMultipart" Version="0.1.4" />
<PackageReference Include="HttpMultipart"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add HttpMultipart --version 0.1.4
#r "nuget: HttpMultipart, 0.1.4"
#:package HttpMultipart@0.1.4
#addin nuget:?package=HttpMultipart&version=0.1.4
#tool nuget:?package=HttpMultipart&version=0.1.4
HttpMultipart
Source only package for reading and writing HTTP multipart content.
The reader is vendored from Microsoft.AspNetCore.WebUtilities and stripped of its dependencies, so it
works anywhere a Stream does — a Blazor WebAssembly client, a console app, a library that does not
want Microsoft.Extensions.Primitives and Microsoft.Net.Http.Headers in its dependency graph.
Requires net10.0 or later.
Usage
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="HttpMultipart" Version="*" PrivateAssets="all" />
</ItemGroup>
</Project>
if (response.Content.TryGetMultipartBoundary(out var boundary))
{
await using var body = await response.Content.ReadAsStreamAsync();
var reader = new MultipartReader(boundary, body);
while (await reader.ReadNextSectionAsync() is {} section)
{
var text = await section.ReadAsStringAsync();
}
}
The types live in the HttpMultipart namespace, and the package adds a global using for it wherever
the consuming project has implicit usings enabled.
Key features
- Source only — compiles into the consuming project. No runtime dependency, nothing to deploy, and
the types stay
internalto whoever compiled them. - No package dependencies — not even
Microsoft.Extensions.Primitives. - Reader and writer —
MultipartReaderandMultipartWriter, tested against each other. - Behaviourally identical to aspnetcore — the upstream test suite passes against it unchanged.
Documentation
See the full documentation on GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.