Introduced
When the site added a page, at this time this page is not able to be immediately included in Baidu, if you want to be the fastest speed Baidu is included in the Baidu Webmaster tools can be used to submit the link to the initiative to Baidu, let Baidu included the page.
This article demonstrates the active push of Java using native HTTP post for linking
Code
String url="http://data.zz.baidu.com/urls?site=wenhaofan.com&token=kZ4mRWVQGEsoJvbz";Kv headers=Kv.by("User-Agent", "curl/7.12.1 ").set("Host", "data.zz.baidu.com").set("Content-Type", "text/plain").set("Content-Length", "83");String result=HttpKit.post(url, "http://wenhaofan.com/article/20180618180327\nhttp://wenhaofan.com/article/fast-reboot-tomcat",headers);System.out.println(result);
URL for Baidu Webmaster Management in the link submission page provided in the push interface of the interface call address
Headers setting the POST request request header
The second parameter in the Httkit.post () method is the URL of a Web page that needs to be pushed, with multiple URLs separated by \ n
One of the Kv,httpkit tools can be downloaded below click
Resources download
Httpkit class (Click to download)
KV Tool Class (click to download)
3 Line Java Code implementation Baidu Webmaster initiative push 12