Install as NuGet package:
Install-Package HttpPostSerializer
.NET CLI:
dotnet add package HttpPostSerializer
class POCO {
[HttpProperty("id")]
public int Id { get; set; }
[HttpProperty("firstname")]
public string FirstName { get; set; }
[HttpProperty("lastname")]
public string LastName { get; set; }
}
static void Main(string[] args) {
var poco = new POCO() {
Id = 1,
FirstName = "John",
LatName = "Doe"
};
FormUrlEncodedContent content = HttpPostConverter.SerializeObject(poco);
}