What is Ping service?
Ping is an update Notification Service Based on the xml_rpc standard protocol. It is used by a blog to quickly notify Baidu of content updates, so that Baidu can capture and update content in a timely manner.
Ping Service Usage
You can use the ping service either by means of manual notification or automatic notification:
Manual Ping: Access Logging.
Automatic Ping: If your blogProgramSupports automatic ping. You only need to configure Baidu's ping service address to your blog publishing background or client program to implement the automatic notification function. Baidu Ping service address: http://ping.baidu.com/ping/RPC2
Xml_rpc for automatic Ping
XML-RPC customer requests sent to Baidu Ping services must contain the following elements:
RPC endpoint: http://ping.baidu.com/ping/RPC2
Call Method Name: weblogupdates. extendedping
Parameters: (transmitted in the same order as listed below)
Blog name
Blog Homepage Address
New hairArticleAddress
Blog RSS address
Example of a ping Request Packet
Weblogupdates. extendedping XML-RPC Request example:
Post/ping/rpc2 HTTP/1.0user-AGENT: requesthost: Ping. Baidu. comcontent-type: text/xmlcontent-length: 511 <? XML version = "1.0" encoding = "UTF-8"?> <Methodcall> <methodname> weblogupdates. extendedping </methodname> <Params> <param> <value> <string> Baidu space </string> </value> </param> <value> <string> http://hi.baidu.com/baidu/ </string> </value> </param> <value> <string> http://baidu.com/blog/example.html </string> </value> </param> <value> <string> http://hi.baidu.com/baidu/rss </string> </value> </param> </Params> </methodcall>
Example of Ping-service response:
Ping-service returns the http_method_not_allowed (405) Error for a non-post Method RequestCode
Return the http_request_entity_too_large (413) error code for the oversized error package.
Return the http_unsupported_media_type (415) error code for a non-"text/XML" Request Packet
In other cases, return the http_ OK (200) code.
The XML-RPC response http package contains an XML document with an int value. 0 indicates that the push is successful, and other values indicate that the push fails. Currently, only 0 and 1 are supported.
When the push is successful, the server response package is:
HTTP/1.1 200 okdate: Mon, 11 May 2009 11:54:53 gmtcontent-length: 156 connection: closecontent-type: text/XML <? XML version = "1.0" encoding = "UTF-8"?> <Methodresponse> <Params> <param> <value> <int> 0 </int> </value> </param> </Params> </methodresponse>
When the push fails, the server response package is:
HTTP/1.1 200 okdate: Mon, 11 May 2009 11:54:53 gmtcontent-length: 156 connection: closecontent-type: text/XML
1