I'm trying to build a c# web page that accepts xml code generated by another computer. So I want to accept a string and then send it into my code. I have looked here: Getting a POST variable but that question lacks the explanation of how to invoke your code opon receiving a request. Reading: https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx as suggested in How to send and receive the POST request in asp.net? didn't help either.
I have also found the ProcessRequest(HttpContext context) function that I can override in the aspx.cs. But that does not seem to contain a easy way to extract it's content? EDIT seems I can call context.request.QueryString for the data that's inside but how I then respond to said request? Or am I do it all wrong?
something like what I want is:
public partial class WebForm1 : System.Web.UI.Page{
BaseSocket bs = new BaseSocket();
public void OnReceivedPost(object sender , string value)
{
sender.answer(bs.ConnectToCode(value));
}
}
So that if the other send a web request to www.example.com then it goes into my code (connectToCode).