Reusable extension methods and helpers for .NET
$ dotnet add package AlphaX.Extensions.HttpContent@HttpContentExtensions provides utility methods for working with HttpContent in .NET applications. It simplifies reading, writing, and manipulating HTTP content in various formats.
HttpContent as string, JSON, or byte array.HttpContent as JSON.dotnet add package AlphaX.Extensions.HttpContent
using AlphaX.Extensions.HttpContent;
// Read content as string
string content = await httpContent.ReadAsStringAsyncEx();
// Deserialize JSON content
MyModel model = await httpContent.ReadFromJsonAsyncEx<MyModel>();
// Write object as JSON content
HttpContent content = myObject.ToJsonContent();
HttpContentToJsonStringHttpContentToJsonStringAsyncHttpContentToTypeAsync<T>HttpContentToType<T>Contributions are welcome! Please submit issues or pull requests via GitHub.
MIT