System.Net.Http.Json 10.0.2

About

Provides extension methods for System.Net.Http.HttpClient and System.Net.Http.HttpContent that facilitate serialization and deserialization of HTTP requests using System.Text.Json.

Key Features

  • Extension methods for deserializing HTTP response JSON bodies.
  • Extension methods for serializing HTTP request JSON bodies.
  • Extension methods for deserializing JSON from HttpContent instances.

How to Use

using System.Net.Http.Json;

using var client = new HttpClient();

// Get the list of all books
Book[] books = await client.GetFromJsonAsync<Book[]>("https://api.contoso.com/books");

// Send a POST request to add a new book
var book = new Book(id: 42, "Title", "Author", publishedYear: 2023);
HttpResponseMessage response = await client.PostAsJsonAsync($"https://api.contoso.com/books/{book.id}", book);

if (response.IsSuccessStatusCode)
    Console.WriteLine("Book added successfully.");
else
    Console.WriteLine($"HTTP request failed with status code: {response.StatusCode}");

public record Book(int id, string title, string author, int publishedYear);

Main Types

The main types provided by this library are:

  • HttpClientJsonExtensions
  • HttpContentJsonExtensions

Additional Documentation

Feedback & Contributing

System.Net.Http.Json is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Net.Http.Json.

Packages Downloads
Refit
The automatic type-safe REST library for Xamarin and .NET
53
Refit
The automatic type-safe REST library for Xamarin and .NET
47
Refit
The automatic type-safe REST library for Xamarin and .NET
45
Refit
The automatic type-safe REST library for Xamarin and .NET
44
Refit
The automatic type-safe REST library for Xamarin and .NET
43
Refit
The automatic type-safe REST library for Xamarin and .NET
42
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
42
Refit
The automatic type-safe REST library for Xamarin and .NET
40
Refit
The automatic type-safe REST library for Xamarin and .NET
39
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
39
Refit
The automatic type-safe REST library for Xamarin and .NET
38
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
38
Refit
The automatic type-safe REST library for Xamarin and .NET
37
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
37

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET Standard 2.0

.NET 10.0

  • No dependencies.

.NET 8.0

.NET 9.0

Version Downloads Last updated
10.0.2 3 1/13/2026
10.0.1 4 12/11/2025
10.0.0 11 11/15/2025
10.0.0-rc.2.25502.107 11 10/18/2025
10.0.0-rc.1.25451.107 10 9/11/2025
10.0.0-preview.7.25380.108 11 8/13/2025
10.0.0-preview.6.25358.103 13 7/15/2025
10.0.0-preview.5.25277.114 15 6/8/2025
10.0.0-preview.4.25258.110 17 5/23/2025
10.0.0-preview.3.25171.5 22 5/2/2025
10.0.0-preview.2.25163.2 22 3/23/2025
10.0.0-preview.1.25080.5 23 2/27/2025
9.0.12 3 1/13/2026
9.0.11 13 11/14/2025
9.0.10 6 10/18/2025
9.0.9 10 9/12/2025
9.0.8 11 8/13/2025
9.0.7 11 7/8/2025
9.0.6 18 6/12/2025
9.0.5 18 5/24/2025
9.0.4 20 4/24/2025
9.0.3 19 3/12/2025
9.0.2 28 2/21/2025
9.0.1 24 2/9/2025
9.0.0 25 12/18/2024
9.0.0-rc.2.24473.5 25 12/15/2024
9.0.0-rc.1.24431.7 21 9/11/2024
9.0.0-preview.7.24405.7 23 8/28/2024
9.0.0-preview.6.24327.7 20 8/13/2024
9.0.0-preview.5.24306.7 23 6/18/2024
9.0.0-preview.4.24266.19 27 6/22/2024
9.0.0-preview.3.24172.9 30 6/22/2024
9.0.0-preview.2.24128.5 29 6/18/2024
9.0.0-preview.1.24080.9 24 6/18/2024
8.0.1 25 12/18/2024
8.0.0 28 6/18/2024
8.0.0-rc.2.23479.6 24 6/18/2024
8.0.0-rc.1.23419.4 25 6/18/2024
8.0.0-preview.7.23375.6 23 6/22/2024
8.0.0-preview.6.23329.7 23 6/18/2024
8.0.0-preview.5.23280.8 28 6/18/2024
8.0.0-preview.4.23259.5 25 6/18/2024
8.0.0-preview.3.23174.8 31 6/18/2024
8.0.0-preview.2.23128.3 26 6/18/2024
8.0.0-preview.1.23110.8 26 6/18/2024
7.0.1 29 6/22/2024
7.0.0 23 6/18/2024
7.0.0-rc.2.22472.3 23 6/22/2024
7.0.0-rc.1.22426.10 21 6/18/2024
7.0.0-preview.7.22375.6 24 6/18/2024
7.0.0-preview.6.22324.4 24 6/24/2024
7.0.0-preview.5.22301.12 39 6/18/2024
7.0.0-preview.4.22229.4 24 6/18/2024
7.0.0-preview.3.22175.4 25 6/22/2024
7.0.0-preview.2.22152.2 49 6/22/2024
7.0.0-preview.1.22076.8 25 6/18/2024
6.0.2 27 12/18/2024
6.0.2-mauipre.1.22102.15 23 6/18/2024
6.0.2-mauipre.1.22054.8 27 6/18/2024
6.0.1 27 6/18/2024
6.0.0 25 6/13/2024
6.0.0-rc.2.21480.5 26 6/22/2024
6.0.0-rc.1.21451.13 22 6/18/2024
6.0.0-preview.7.21377.19 25 6/22/2024
6.0.0-preview.6.21352.12 27 6/18/2024
6.0.0-preview.5.21301.5 26 6/18/2024
6.0.0-preview.4.21253.7 23 6/18/2024
6.0.0-preview.3.21201.4 23 6/18/2024
6.0.0-preview.2.21154.6 27 6/18/2024
6.0.0-preview.1.21102.12 26 6/22/2024
5.0.0 33 6/18/2024
5.0.0-rc.2.20475.5 23 6/22/2024
5.0.0-rc.1.20451.14 26 6/22/2024
5.0.0-preview.8.20407.11 28 6/18/2024
5.0.0-preview.7.20364.11 27 6/18/2024
5.0.0-preview.6.20305.6 26 6/22/2024
5.0.0-preview.5.20278.1 25 6/22/2024
5.0.0-preview.4.20251.6 26 6/18/2024
5.0.0-preview.3.20214.6 23 6/18/2024
3.2.1 26 6/18/2024
3.2.0 29 6/22/2024
3.2.0-rc1.20217.1 22 6/18/2024
3.2.0-preview5.20210.3 35 6/18/2024
3.2.0-preview3.20175.8 32 6/18/2024