Serialize XmlDocument & send via HTTPWebRequest

后端 未结 3 1942
半阙折子戏
半阙折子戏 2021-01-14 21:29

I\'m trying to figure out how to properly serialize my XmlDocument and send it via a HTTPWebRequest object.

Here\'s what I have thus far:

Stream reques         


        
3条回答
  •  被撕碎了的回忆
    2021-01-14 22:25

    I'm doing this now with UPS, instead of building the documents in XML, I just used string builders like so:

    ... in code:

    AddNode("name", "value");
    

    ...in class:

    private StringBuilder sb;
    public void AddNode(string name, string value) 
    {
        sb.Append("<" + name + ">" + value + "");
    }
    

    I personally think it's better, because it reduces the server load.

提交回复
热议问题