Home>

The current code is here.
I googled variously and tried various things, but I could not solve it, so I will ask you a question here.

Please help someone m (_ _) m

var xml = new StringWriter ();
var serializer = new XmlSerializer (typeof (RequestXmlModel));
var namespaces = new XmlSerializerNamespaces ();
namespaces.Add (string.Empty, string.Empty);
RequestXmlModel request = new RequestXmlModel ();
serializer.Serialize (xml, request, namespaces);
using (var client = new HttpClient ())
{
  var request = new HttpRequestMessage (HttpMethod.Post, $"url");
  request.Content = new StringContent (xml.ToString (), Encoding.UTF8);
  var response = await client.SendAsync (request);
  if (response.StatusCode == HttpStatusCode.OK)
  {
    var stream = response.Content.ReadAsStreamAsync ();
    using (Stream s = await stream)
    {
      using (StreamReader sr = new StreamReader (s))
      {
        var xmlResponse = sr.ReadToEnd ();
        return xmlResponse;
      }
    }
  }
  return response.ToString ();
}