System.Net.Http.Json 11.0.0-preview.2.26159.112

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
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
107
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
109
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
112
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
110
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
116
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
119
Refit
The automatic type-safe REST library for Xamarin and .NET
109
Refit
The automatic type-safe REST library for Xamarin and .NET
111
Refit
The automatic type-safe REST library for Xamarin and .NET
113
Refit
The automatic type-safe REST library for Xamarin and .NET
114
Refit
The automatic type-safe REST library for Xamarin and .NET
115
Refit
The automatic type-safe REST library for Xamarin and .NET
117
Refit
The automatic type-safe REST library for Xamarin and .NET
119
Refit
The automatic type-safe REST library for Xamarin and .NET
121
Refit
The automatic type-safe REST library for Xamarin and .NET
130
Refit
The automatic type-safe REST library for Xamarin and .NET
140

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

.NET Framework 4.6.2

.NET 10.0

.NET 11.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.2.26159.112 1 03/12/2026
11.0.0-preview.1.26104.118 9 02/11/2026
10.0.5 0 03/12/2026
10.0.4 1 03/12/2026
10.0.3 8 02/11/2026
10.0.2 17 01/13/2026
10.0.1 30 12/13/2025
10.0.0 36 11/12/2025
10.0.0-rc.2.25502.107 49 10/14/2025
10.0.0-rc.1.25451.107 65 09/09/2025
10.0.0-preview.7.25380.108 59 08/14/2025
10.0.0-preview.6.25358.103 73 07/18/2025
10.0.0-preview.5.25277.114 67 06/06/2025
10.0.0-preview.4.25258.110 82 05/17/2025
10.0.0-preview.3.25171.5 90 04/11/2025
10.0.0-preview.2.25163.2 73 04/02/2025
10.0.0-preview.1.25080.5 78 04/02/2025
9.0.14 1 03/12/2026
9.0.13 7 02/11/2026
9.0.12 14 01/13/2026
9.0.11 36 11/12/2025
9.0.10 59 10/14/2025
9.0.9 65 09/09/2025
9.0.8 66 08/05/2025
9.0.7 60 07/09/2025
9.0.6 83 06/12/2025
9.0.5 59 05/17/2025
9.0.4 73 04/11/2025
9.0.3 86 04/02/2025
9.0.2 86 04/02/2025
9.0.1 83 03/31/2025
9.0.0 74 11/14/2024
9.0.0-rc.2.24473.5 73 10/23/2024
9.0.0-rc.1.24431.7 80 09/19/2024
9.0.0-preview.7.24405.7 79 10/23/2024
9.0.0-preview.6.24327.7 76 10/21/2024
9.0.0-preview.5.24306.7 85 09/20/2024
9.0.0-preview.4.24266.19 100 10/21/2024
9.0.0-preview.3.24172.9 89 10/23/2024
9.0.0-preview.2.24128.5 74 10/23/2024
9.0.0-preview.1.24080.9 84 10/23/2024
8.0.1 90 10/21/2024
8.0.0 95 10/21/2024
8.0.0-rc.2.23479.6 83 10/21/2024
8.0.0-rc.1.23419.4 83 10/23/2024
8.0.0-preview.7.23375.6 84 09/20/2024
8.0.0-preview.6.23329.7 85 10/23/2024
8.0.0-preview.5.23280.8 91 09/20/2024
8.0.0-preview.4.23259.5 80 10/23/2024
8.0.0-preview.3.23174.8 88 09/20/2024
8.0.0-preview.2.23128.3 107 09/20/2024
8.0.0-preview.1.23110.8 85 10/23/2024
7.0.1 80 10/21/2024
7.0.0 77 10/21/2024
7.0.0-rc.2.22472.3 81 09/20/2024
7.0.0-rc.1.22426.10 81 10/23/2024
7.0.0-preview.7.22375.6 81 10/21/2024
7.0.0-preview.6.22324.4 85 10/23/2024
7.0.0-preview.5.22301.12 90 10/21/2024
7.0.0-preview.4.22229.4 79 10/23/2024
7.0.0-preview.3.22175.4 90 10/23/2024
7.0.0-preview.2.22152.2 82 09/20/2024
7.0.0-preview.1.22076.8 71 09/20/2024
6.0.2 82 11/14/2024
6.0.1 76 10/21/2024
6.0.0 82 10/21/2024
6.0.0-rc.2.21480.5 82 09/20/2024
6.0.0-rc.1.21451.13 79 10/23/2024
6.0.0-preview.7.21377.19 78 10/21/2024
6.0.0-preview.6.21352.12 84 10/21/2024
6.0.0-preview.5.21301.5 81 10/23/2024
6.0.0-preview.4.21253.7 82 10/23/2024
6.0.0-preview.3.21201.4 79 10/23/2024
6.0.0-preview.2.21154.6 71 10/23/2024
6.0.0-preview.1.21102.12 75 10/21/2024
5.0.0 72 09/20/2024
5.0.0-rc.2.20475.5 88 10/21/2024
5.0.0-rc.1.20451.14 76 10/23/2024
5.0.0-preview.8.20407.11 84 10/21/2024
5.0.0-preview.7.20364.11 87 10/21/2024
5.0.0-preview.6.20305.6 76 10/23/2024
5.0.0-preview.5.20278.1 83 10/23/2024
5.0.0-preview.4.20251.6 87 10/23/2024
5.0.0-preview.3.20214.6 93 09/20/2024
3.2.1 102 10/21/2024
3.2.0 80 10/21/2024
3.2.0-rc1.20217.1 68 10/21/2024
3.2.0-preview5.20210.3 80 10/21/2024
3.2.0-preview3.20175.8 95 09/20/2024