Hi all, I'm trying to make a simple HTTP post a endpoint with ONLY url arguments.
At least thats how I understand the following instructions:
POST to that address with a single parameter named url, the address of the feed that changed.
As with the XML-RPC method, it verifies that the feed has changed, and if so it notifies the subscribers.
The event is logged. The return value is an XML message named result, with two attributes, success and msg.
This is my code currently:
public static void ping(string feed)
{
HttpWebResponse response = MakeRequest(feed);
XmlDocument document = new XmlDocument();
document.Load(response.GetResponseStream();
string success = document.GetElementById("success").InnerText;
string msg = document.GetElementById("msg").InnerText;
MessageBox.Show(msg, success);
}
private static HttpWebResponse MakeRequest( string postArgument)
{
string url = path + "?" + UrlEncode(postArgument);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
return (HttpWebResponse)request.GetResponse();
}
private static string UrlEncode( string value)
{
string result;
result= HttpUtility.UrlEncode("url") + "=" + HttpUtility.UrlEncode(value);
return result;
}
I'm getting an incorrect response from the server so i assume I'm doing it wrong somehow. here is the response:
Invalid at the top level of the document. Error processing resource 'file:///C:/Users/ADMIN/AppData/Local/Temp/VSD1.tmp.XML...
rue ^
Any ideas??
Thanks in advance