我有一个经典的asp应用程序,它使用MSXML2.ServerXMLHTTP通过查询字符串将数据传递给API,并读取\处理响应。我正在测试ASP.Net网页(这不是MVC 4)并尝试移植它,但不知道如何。
这是原始经典asp(vbscript)代码的一个子集:
PostData = "variable1=test"
PostData = PostData & "variable2=test"
'Send the transaction info as part of the querystring
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
xml.open "POST", "https://www.domain.com/api/file.aspx?" & PostData & "", false
xml.send ""
strStatus = xml.Status
strRetval = xml.responseText
set xml = nothing
Results = split(strRetVal, ",", -1)
responseCode = Results (0)
responseReasonCode = Results (1)
responseId = Results (2)
If (responseCode = 1) then
newID = responseId
END IF
如何使用ASP.Net网页完成此操作?请记住,网页不同但与MVC(http://www.asp.net/web-pages)类似。
答案 0 :(得分:0)