0

Is is it possible to post by using HttpClient class with properties as XmlAttributes? For example we have class:

public class request
{
  public string attribute1 { get; set; }

  public string attribute2 { get; set; }
}

By using PostAsXmlAsync method. What attributes I have to use to get request like that:

<request attribute1="value" attribute2="value" />

I've tried to use in that way

[XmlRoot("request")]
public class request
{
  [XmlAttribute("attricute1")]
  public string attribute1 { get; set; }
  [XmlAttribute("attricute1")]
  public string attribute2 { get; set; }
}

But got result:

<request>
 <attribute1></attribute1>
 <attribute2></attribute2>
</request>
Y. Ivan
  • 109
  • 1
  • 9

0 Answers0