I was looking for the PostAsJsonAsync()
extension method in ASP.NET Core. Based on this article, it's available in the Microsoft.AspNet.WebApi.Client
assembly.
I had thought Microsoft had changed all of the assembly names from Microsoft.AspNet
to Microsoft.AspNetCore
to be more specific to .NET Core, however, and yet I cannot find an Microsoft.AspNetCore.WebApi.Client
assembly.
Where is the PostAsJsonAsync()
extension method in ASP.NET Core?
PostAsJsonAsync<T>(HttpClient, Uri, T) Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. PostAsJsonAsync<T>(HttpClient, Uri, T, CancellationToken) Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON.
HttpClient' does not contain a definition for 'PostAsJsonAsync' and No extension method 'PostAsJsonAsync' accepting a first argument of type 'System.
Provides a programming interface for modern HTTP applications, including HTTP client components that allow applications to consume web services over HTTP and HTTP components that can be used by both clients and servers for parsing HTTP headers.
It comes as part of the library Microsoft.AspNet.WebApi.Client
https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Client/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With