我需要将此请求发送到服务器:
StringContent myContent = "<?xml version=\"1.0\"....";
HttpClient myClient = new HttpClient();
Uri myUri = new Uri("http://desktop-t3ipeqk:444/xml");
myClient.PostAsync(myUri, myContent);
myClient.DefaultRequestHeaders.Add("STW-Autorization", "Admin admin");
myClient.DefaultRequestHeaders.Add("Content-Type", "text/xml");
myClient.DefaultRequestHeaders.Add("Accept-Encoding", "gzip, deflate");
myClient.DefaultRequestHeaders.Add("Host", "http://desktop-t3ipeqk:444");
myClient.DefaultRequestHeaders.Add("Content-Length", "527");
myClient.DefaultRequestHeaders.Add("Pragma", "no-cache");
myClient.DefaultRequestHeaders.Add("Connection", "Keep-Alive");
我像这样向HttpClient获取数据,但我不知道如何发送xml。
googleway
我会很乐意接受任何建议。