Baidu Webmaster Platform link submitted by the active push: the fastest way to submit, we recommend that you will be the site of the new output link immediately by this way to push to Baidu, to ensure that the new link can be included in time by Baidu.
Post push, C # code implementation
Public stringGetPage (stringPostURL,stringpostdata) {Stream OutStream=NULL; Stream instream=NULL; StreamReader SR=NULL; HttpWebResponse Response=NULL; HttpWebRequest Request=NULL; Encoding Encoding= System.Text.Encoding.GetEncoding ("gb2312"); byte[] data =encoding. GetBytes (PostData); //Prepare request ... Try { //Setting ParametersRequest = WebRequest.Create (PostURL) asHttpWebRequest; Cookiecontainer Cookiecontainer=NewCookiecontainer (); Request. UserAgent="curl/7.12.1"; Request. Cookiecontainer=Cookiecontainer; Request. AllowAutoRedirect=true; Request. Method="POST"; Request. ContentType="Text/plain"; Request. ContentLength=data. Length; OutStream=request. GetRequestStream (); OutStream. Write (data,0, data. Length); OutStream. Close (); //send request and get corresponding response dataResponse = Request. GetResponse () asHttpWebResponse; //until request. The GetResponse () program only starts sending a POST request to the destination Web pageInstream =Response. GetResponseStream (); SR=NewStreamReader (instream, encoding); //return result Web page (HTML) code stringContent =Sr. ReadToEnd (); stringErr =string. Empty; returncontent; } Catch(Exception ex) {stringErr =Ex. Message; returnerr; } }
C # Implementation of Baidu Webmaster Platform-Link submission-active push post push