SolTechnology.Avro.Http 4.0.0-preview.4

This is a prerelease version of SolTechnology.Avro.Http.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SolTechnology.Avro.Http --version 4.0.0-preview.4
                    
NuGet\Install-Package SolTechnology.Avro.Http -Version 4.0.0-preview.4
                    
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="SolTechnology.Avro.Http" Version="4.0.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SolTechnology.Avro.Http" Version="4.0.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="SolTechnology.Avro.Http" />
                    
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 SolTechnology.Avro.Http --version 4.0.0-preview.4
                    
#r "nuget: SolTechnology.Avro.Http, 4.0.0-preview.4"
                    
#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 SolTechnology.Avro.Http@4.0.0-preview.4
                    
#: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=SolTechnology.Avro.Http&version=4.0.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SolTechnology.Avro.Http&version=4.0.0-preview.4&prerelease
                    
Install as a Cake Tool

SolTechnology.Avro.Http

Apache Avro (application/avro) as the wire format between HTTP services, built on AvroConvert. The API mirrors System.Net.Http.Json: plain C# classes in and out, no code generation.

dotnet add package SolTechnology.Avro.Http

HttpClient

var order = await httpClient.GetFromAvroAsync<Order>("orders/1");        // sends Accept: application/avro
using var response = await httpClient.PostAsAvroAsync("orders", order);  // also PutAsAvroAsync, PatchAsAvroAsync
var created = await response.Content.ReadFromAvroAsync<Order>();
var content = AvroContent.Create(order, new AvroConvertOptions { Codec = CodecType.Brotli });

ASP.NET Core

// MVC controllers: JSON stays the default, Avro is used for Content-Type / Accept: application/avro
builder.Services.AddControllers().AddAvroFormatters();

// Minimal APIs
app.MapPost("/orders", (Avro<Order> order) => Results.Extensions.Avro(order.Value, statusCode: 201));
app.MapGet("/orders/{id}", (int id) => AvroResults.Avro(repository.Get(id)));

A body that is not valid Avro is a 400. A Minimal API Avro<T> parameter answers 415 to other content types.

Streaming

Large results and uploads go over the wire block by block. Only the current block is held in memory, on both sides.

app.MapGet("/orders", (OrderStore store) => AvroResults.Stream(store.ReadAllAsync()));   // IAsyncEnumerable<Order>
app.MapPost("/orders/import", async (AvroStream<Order> orders) =>
{
    await foreach (var order in orders) { /* … */ }
});

await foreach (var order in httpClient.GetFromAvroAsAsyncEnumerable<Order>("orders")) { /* … */ }
await httpClient.PostAsAvroStreamAsync("orders/import", ReadOrdersAsync());

Every method takes optional AvroConvertOptions (codec, naming policy, converters) and a CancellationToken.

Licence

Free for noncommercial use and for companies under 100 people and USD 1M revenue (PolyForm Noncommercial / Small Business). Other organisations need a commercial licence: soltechnology.dev/avroconvert. See LICENSE.md in the package.

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.

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
4.0.0 48 11/11/2026
4.0.0-preview.4 58 11/2/2026
4.0.0-preview.3 60 10/28/2026
4.0.0-preview.2 67 10/25/2026
4.0.0-preview.1 65 10/24/2026
3.0.1 1,280 2/1/2025
3.0.0 4,233 3/26/2021
2.7.0 704 12/27/2020
0.2.0 765 4/25/2020
0.1.0 765 3/31/2020