How to get status code of a POST with Asp.Net HttpWebRequest

Posted by Hasan Gürsoy on Stack Overflow See other posts from Stack Overflow or by Hasan Gürsoy
Published on 2010-04-10T07:30:16Z Indexed on 2010/04/10 7:33 UTC
Read the original article Hit count: 310

I'm trying to ping Google when my web site's sitemap is updated but I need to know which status code does Google or any other service returns. My code is below:

HttpWebRequest rqst = (HttpWebRequest)WebRequest.Create("http://search.yahooapis.com/ping?sitemap=http%3a%2f%2fhasangursoy.com.tr%2fsitemap.xml");
rqst.Method = "POST";
rqst.ContentType = "text/xml";
rqst.ContentLength = 0;
rqst.Timeout = 3000;

rqst.GetResponse();

© Stack Overflow or respective owner

Related posts about search-engine

Related posts about sitemap