I have classic asp project developed which is returning XML. Now I need to post that XML to ASP.NET WebAPI.
Below is the code for Classic ASP:
Dim testString
Dim xmlHTTP
Dim postUrl
Dim responseXML
Dim responseText
testString = "This is a test string"
postUrl = "http://localhost:55823/api/order/"
responseText = ""
Set xmlHTTP = server.Createobject("MSXML2.XMLHTTP")
xmlHTTP.Open "POST", postUrl, false
xmlHTTP.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
On Error Resume Next
xmlHTTP.send testString
response.Write testString
Below is how I am calling in WebAPI :
[HttpPost]
public HttpResponseMessage Post([FromBody]string testString)
{
}
But here testString is always returning Null. I even tried public string Post().
Can someone help me in this!!