加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 将正文添加到与天蓝服务一起使用的HttpWebRequest mgmt ap

发布时间:2020-12-15 04:04:39 所属栏目:百科 来源:网络整理
导读:我将如何添加到HttpWebRequest的正文? 身体需要由以下组成 ?xml version="1.0" encoding="utf-8"?ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure" Configurationbase-64-encoded-configuration-file/Configuration TreatWarningsAs
我将如何添加到HttpWebRequest的正文?

身体需要由以下组成

<?xml version="1.0" encoding="utf-8"?>
<ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure">
   <Configuration>base-64-encoded-configuration-file</Configuration>
   <TreatWarningsAsError>true|false</TreatWarningsAsError>
   <Mode>Auto|Manual</Mode>
</ChangeConfiguration>

任何帮助深表感谢

解决方法

byte[] buf = Encoding.UTF8.GetBytes(xml);

request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = buf.Length;
request.GetRequestStream().Write(buf,buf.Length);

var HttpWebResponse = (HttpWebResponse)request.GetResponse();

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读