System.Net.Http.Json 10.0.12

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.
149
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
149
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
150
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
156
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
159
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
163
Refit
The automatic type-safe REST library for Xamarin and .NET
149
Refit
The automatic type-safe REST library for Xamarin and .NET
153
Refit
The automatic type-safe REST library for Xamarin and .NET
154
Refit
The automatic type-safe REST library for Xamarin and .NET
155
Refit
The automatic type-safe REST library for Xamarin and .NET
159
Refit
The automatic type-safe REST library for Xamarin and .NET
160
Refit
The automatic type-safe REST library for Xamarin and .NET
164
Refit
The automatic type-safe REST library for Xamarin and .NET
169
Refit
The automatic type-safe REST library for Xamarin and .NET
192

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
11.0.0-rc.1.26425.128 5 09/09/2026
11.0.0-preview.7.26381.103 12 08/12/2026
11.0.0-preview.6.26359.118 17 07/18/2026
11.0.0-preview.5.26302.115 22 06/11/2026
11.0.0-preview.4.26230.115 36 05/13/2026
11.0.0-preview.3.26207.106 43 04/14/2026
11.0.0-preview.2.26159.112 44 03/12/2026
11.0.0-preview.1.26104.118 47 02/11/2026
10.0.12 5 09/09/2026
10.0.11 15 08/12/2026
10.0.10 20 07/19/2026
10.0.9 24 06/11/2026
10.0.8 37 05/13/2026
10.0.7 39 04/21/2026
10.0.6 49 04/14/2026
10.0.5 45 03/13/2026
10.0.4 47 03/12/2026
10.0.3 46 02/11/2026
10.0.2 61 01/13/2026
10.0.1 70 12/13/2025
10.0.0 76 11/12/2025
10.0.0-rc.2.25502.107 87 10/14/2025
10.0.0-rc.1.25451.107 106 09/09/2025
10.0.0-preview.7.25380.108 96 08/14/2025
10.0.0-preview.6.25358.103 118 07/18/2025
10.0.0-preview.5.25277.114 106 06/06/2025
10.0.0-preview.4.25258.110 123 05/17/2025
10.0.0-preview.3.25171.5 137 04/11/2025
10.0.0-preview.2.25163.2 112 04/02/2025
10.0.0-preview.1.25080.5 117 04/02/2025
9.0.20 2 09/10/2026
9.0.19 9 08/12/2026
9.0.18 18 07/18/2026
9.0.17 19 06/10/2026
9.0.16 23 05/13/2026
9.0.15 46 04/14/2026
9.0.14 46 03/12/2026
9.0.13 49 02/11/2026
9.0.12 52 01/13/2026
9.0.11 74 11/12/2025
9.0.10 97 10/14/2025
9.0.9 113 09/09/2025
9.0.8 102 08/05/2025
9.0.7 104 07/09/2025
9.0.6 124 06/12/2025
9.0.5 107 05/17/2025
9.0.4 118 04/11/2025
9.0.3 136 04/02/2025
9.0.2 126 04/02/2025
9.0.1 119 03/31/2025
9.0.0 109 11/14/2024
9.0.0-rc.2.24473.5 111 10/23/2024
9.0.0-rc.1.24431.7 123 09/19/2024
9.0.0-preview.7.24405.7 115 10/23/2024
9.0.0-preview.6.24327.7 114 10/21/2024
9.0.0-preview.5.24306.7 122 09/20/2024
9.0.0-preview.4.24266.19 138 10/21/2024
9.0.0-preview.3.24172.9 125 10/23/2024
9.0.0-preview.2.24128.5 114 10/23/2024
9.0.0-preview.1.24080.9 129 10/23/2024
8.0.1 127 10/21/2024
8.0.0 134 10/21/2024
8.0.0-rc.2.23479.6 117 10/21/2024
8.0.0-rc.1.23419.4 115 10/23/2024
8.0.0-preview.7.23375.6 141 09/20/2024
8.0.0-preview.6.23329.7 121 10/23/2024
8.0.0-preview.5.23280.8 135 09/20/2024
8.0.0-preview.4.23259.5 119 10/23/2024
8.0.0-preview.3.23174.8 129 09/20/2024
8.0.0-preview.2.23128.3 144 09/20/2024
8.0.0-preview.1.23110.8 124 10/23/2024
7.0.1 134 10/21/2024
7.0.0 111 10/21/2024
7.0.0-rc.2.22472.3 120 09/20/2024
7.0.0-rc.1.22426.10 121 10/23/2024
7.0.0-preview.7.22375.6 114 10/21/2024
7.0.0-preview.6.22324.4 122 10/23/2024
7.0.0-preview.5.22301.12 124 10/21/2024
7.0.0-preview.4.22229.4 119 10/23/2024
7.0.0-preview.3.22175.4 125 10/23/2024
7.0.0-preview.2.22152.2 121 09/20/2024
7.0.0-preview.1.22076.8 106 09/20/2024
6.0.2 123 11/14/2024
6.0.1 110 10/21/2024
6.0.0 118 10/21/2024
6.0.0-rc.2.21480.5 119 09/20/2024
6.0.0-rc.1.21451.13 117 10/23/2024
6.0.0-preview.7.21377.19 117 10/21/2024
6.0.0-preview.6.21352.12 118 10/21/2024
6.0.0-preview.5.21301.5 116 10/23/2024
6.0.0-preview.4.21253.7 121 10/23/2024
6.0.0-preview.3.21201.4 111 10/23/2024
6.0.0-preview.2.21154.6 107 10/23/2024
6.0.0-preview.1.21102.12 111 10/21/2024
5.0.0 109 09/20/2024
5.0.0-rc.2.20475.5 129 10/21/2024
5.0.0-rc.1.20451.14 110 10/23/2024
5.0.0-preview.8.20407.11 122 10/21/2024
5.0.0-preview.7.20364.11 124 10/21/2024
5.0.0-preview.6.20305.6 124 10/23/2024
5.0.0-preview.5.20278.1 115 10/23/2024
5.0.0-preview.4.20251.6 128 10/23/2024
5.0.0-preview.3.20214.6 126 09/20/2024
3.2.1 137 10/21/2024
3.2.0 115 10/21/2024
3.2.0-rc1.20217.1 102 10/21/2024
3.2.0-preview5.20210.3 108 10/21/2024
3.2.0-preview3.20175.8 134 09/20/2024