Hi Experts I have the code attached, trying to receive a POST from a 3rd party SMS provider. They say in PHP it looks something like
$sender = $_REQUEST['sender'];
$content = $_REQUEST['content'];
$inNumber = $_REQUEST['inNumber'];
$email = $_REQUEST['email'];
$credits = $_REQUEST['credits'];
I need to translate this to ASP.NET and give them the URL they are supposed to send the POST to. would response.aspx be sufficient?
Partial Class response
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strDataToPost As String
Dim myWebRequest As WebRequest
Dim myRequestStream As Stream
Dim myStreamWriter As StreamWriter
Dim myWebResponse As WebResponse
Dim myResponseStream As Stream
Dim myStreamReader As StreamReader
' Create a new WebRequest which targets that page with which we want to interact.
myWebRequest = WebRequest.Create("response.aspx")
' Set the method to "POST" and the content type so the server knows to expect form data in the body of the request.
.Method = "POST"
.ContentType = "application/x-www-form-urlencoded"
myResponseStream = myWebResponse.GetResponseStream()
myStreamReader = New StreamReader(myResponseStream)
Dim FILENAME As String = Server.MapPath("TextFile.txt")
Dim objStreamWriter As StreamWriter
objStreamWriter = File.AppendText(FILENAME)
' Close the WebResponse