System.Net.Http.Json 9.0.19

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.
144
OpenIddict.Client.SystemNetHttp
System.Net.Http integration package for the OpenIddict client services.
145
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
144
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
152
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
153
OpenIddict.Validation.SystemNetHttp
System.Net.Http integration package for the OpenIddict validation services.
159
Refit
The automatic type-safe REST library for Xamarin and .NET
143
Refit
The automatic type-safe REST library for Xamarin and .NET
146
Refit
The automatic type-safe REST library for Xamarin and .NET
147
Refit
The automatic type-safe REST library for Xamarin and .NET
148
Refit
The automatic type-safe REST library for Xamarin and .NET
150
Refit
The automatic type-safe REST library for Xamarin and .NET
151
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
160
Refit
The automatic type-safe REST library for Xamarin and .NET
165
Refit
The automatic type-safe REST library for Xamarin and .NET
186

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

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.7.26381.103 1 08/12/2026
11.0.0-preview.6.26359.118 11 07/18/2026
11.0.0-preview.5.26302.115 16 06/11/2026
11.0.0-preview.4.26230.115 28 05/13/2026
11.0.0-preview.3.26207.106 39 04/14/2026
11.0.0-preview.2.26159.112 38 03/12/2026
11.0.0-preview.1.26104.118 42 02/11/2026
10.0.11 1 08/12/2026
10.0.10 14 07/19/2026
10.0.9 15 06/11/2026
10.0.8 29 05/13/2026
10.0.7 34 04/21/2026
10.0.6 43 04/14/2026
10.0.5 40 03/13/2026
10.0.4 41 03/12/2026
10.0.3 40 02/11/2026
10.0.2 52 01/13/2026
10.0.1 65 12/13/2025
10.0.0 71 11/12/2025
10.0.0-rc.2.25502.107 83 10/14/2025
10.0.0-rc.1.25451.107 97 09/09/2025
10.0.0-preview.7.25380.108 89 08/14/2025
10.0.0-preview.6.25358.103 114 07/18/2025
10.0.0-preview.5.25277.114 101 06/06/2025
10.0.0-preview.4.25258.110 118 05/17/2025
10.0.0-preview.3.25171.5 130 04/11/2025
10.0.0-preview.2.25163.2 106 04/02/2025
10.0.0-preview.1.25080.5 113 04/02/2025
9.0.19 1 08/12/2026
9.0.18 14 07/18/2026
9.0.17 13 06/10/2026
9.0.16 17 05/13/2026
9.0.15 40 04/14/2026
9.0.14 39 03/12/2026
9.0.13 42 02/11/2026
9.0.12 46 01/13/2026
9.0.11 68 11/12/2025
9.0.10 91 10/14/2025
9.0.9 107 09/09/2025
9.0.8 97 08/05/2025
9.0.7 96 07/09/2025
9.0.6 118 06/12/2025
9.0.5 100 05/17/2025
9.0.4 114 04/11/2025
9.0.3 128 04/02/2025
9.0.2 119 04/02/2025
9.0.1 112 03/31/2025
9.0.0 102 11/14/2024
9.0.0-rc.2.24473.5 106 10/23/2024
9.0.0-rc.1.24431.7 118 09/19/2024
9.0.0-preview.7.24405.7 109 10/23/2024
9.0.0-preview.6.24327.7 110 10/21/2024
9.0.0-preview.5.24306.7 117 09/20/2024
9.0.0-preview.4.24266.19 131 10/21/2024
9.0.0-preview.3.24172.9 120 10/23/2024
9.0.0-preview.2.24128.5 107 10/23/2024
9.0.0-preview.1.24080.9 123 10/23/2024
8.0.1 123 10/21/2024
8.0.0 128 10/21/2024
8.0.0-rc.2.23479.6 112 10/21/2024
8.0.0-rc.1.23419.4 111 10/23/2024
8.0.0-preview.7.23375.6 137 09/20/2024
8.0.0-preview.6.23329.7 116 10/23/2024
8.0.0-preview.5.23280.8 129 09/20/2024
8.0.0-preview.4.23259.5 113 10/23/2024
8.0.0-preview.3.23174.8 124 09/20/2024
8.0.0-preview.2.23128.3 140 09/20/2024
8.0.0-preview.1.23110.8 120 10/23/2024
7.0.1 129 10/21/2024
7.0.0 106 10/21/2024
7.0.0-rc.2.22472.3 113 09/20/2024
7.0.0-rc.1.22426.10 114 10/23/2024
7.0.0-preview.7.22375.6 110 10/21/2024
7.0.0-preview.6.22324.4 115 10/23/2024
7.0.0-preview.5.22301.12 119 10/21/2024
7.0.0-preview.4.22229.4 109 10/23/2024
7.0.0-preview.3.22175.4 119 10/23/2024
7.0.0-preview.2.22152.2 114 09/20/2024
7.0.0-preview.1.22076.8 102 09/20/2024
6.0.2 117 11/14/2024
6.0.1 107 10/21/2024
6.0.0 112 10/21/2024
6.0.0-rc.2.21480.5 113 09/20/2024
6.0.0-rc.1.21451.13 111 10/23/2024
6.0.0-preview.7.21377.19 112 10/21/2024
6.0.0-preview.6.21352.12 114 10/21/2024
6.0.0-preview.5.21301.5 110 10/23/2024
6.0.0-preview.4.21253.7 116 10/23/2024
6.0.0-preview.3.21201.4 105 10/23/2024
6.0.0-preview.2.21154.6 103 10/23/2024
6.0.0-preview.1.21102.12 106 10/21/2024
5.0.0 104 09/20/2024
5.0.0-rc.2.20475.5 125 10/21/2024
5.0.0-rc.1.20451.14 104 10/23/2024
5.0.0-preview.8.20407.11 118 10/21/2024
5.0.0-preview.7.20364.11 119 10/21/2024
5.0.0-preview.6.20305.6 120 10/23/2024
5.0.0-preview.5.20278.1 110 10/23/2024
5.0.0-preview.4.20251.6 122 10/23/2024
5.0.0-preview.3.20214.6 122 09/20/2024
3.2.1 133 10/21/2024
3.2.0 109 10/21/2024
3.2.0-rc1.20217.1 97 10/21/2024
3.2.0-preview5.20210.3 103 10/21/2024
3.2.0-preview3.20175.8 129 09/20/2024