HttpClient no serializa XML correctamente
Al llamar al método de extensión de HttpClientPostAsXmlAsync
, ignora elXmlRootAttribute
en la clase ¿Es este comportamiento un error?
Prueba
[Serializable]
[XmlRoot("record")]
class Account
{
[XmlElement("account-id")]
public int ID { get; set }
}
var client = new HttpClient();
await client.PostAsXmlAsync(url, new Account())