HttpMultipart 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package HttpMultipart --version 0.1.0
                    
NuGet\Install-Package HttpMultipart -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HttpMultipart" Version="0.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HttpMultipart" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="HttpMultipart">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HttpMultipart --version 0.1.0
                    
#r "nuget: HttpMultipart, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HttpMultipart@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HttpMultipart&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=HttpMultipart&version=0.1.0
                    
Install as a Cake Tool

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 internal to whoever compiled them.
  • No package dependencies — not even Microsoft.Extensions.Primitives.
  • Reader and writerMultipartReader and MultipartWriter, tested against each other.
  • Behaviourally identical to aspnetcore — the upstream test suite passes against it unchanged.

Documentation

See the full documentation on GitHub.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
0.1.4 152 9/5/2026
0.1.3 69 9/5/2026
0.1.2 218 9/1/2026
0.1.1 102 9/1/2026
0.1.0 60 9/1/2026