我继承了一个 API,它提供了一个如何调用 API 的 Visual Basic 示例,如下所示:
Dim sPost As String
Dim sAction As String
Dim sXMLData As String
Dim sHTTPHeaders As String
sPost = "POST"
sAction = "http://MyHost/1/XmlService"
sXMLData = "<xml ..> <request …….. /></xml>"
sHTTPHeaders = "Content-type: text/xml"
Inet1.Execute sAction, sPost, sXMLData, sHTTPHeaders
我熟悉使用 HttpWebRequest 并且在设置内容类型、方法等方面没有问题,但我不确定如何设置 sXMLData - 我应该设置 HttpWebRequest 的哪个属性?
提前致谢。