通过以下代码可以进行刷取测试

import org.apache.commons.httpclient.methods.GetMethod;

/**
* @author lrx
* @description: TODO
* @date 2021/12/9 17:16
*/
public class RefreshBlog {

private static volatile int number = 0;
private static final String url = "http://51地址";
private static ExecutorService es = Executors.newFixedThreadPool(50);

public static void main(String[] args) {
for (int i = 0; i < 1; i++) {
refreshBlog();
}
;
}
/**
* refreshBlog 这个方法是相应请求
*/
public static void refreshBlog() {
HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod(url);
//csdn
//getMethod.setRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36 LBBROWSER");
//51cto格式
getMethod.setRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36 LBBROWSER")

getMethod.getParams().setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.BROWSER_COMPATIBILITY);
while (true) {
try {
//会造成阻塞因为想网络发起请求.
int statusCode = httpClient.executeMethod(getMethod);
if (statusCode != HttpStatus.SC_OK) {
System.out.print("失败:" + getMethod.getStatusLine());
Thread thread = Thread.currentThread();
thread.sleep(1500);//暂停1.5秒后程序继续执行

}
System.out.println("我操作刷新了:" + number++);

} catch (Exception e) {
System.out.print("请检查地址!");
} finally {
getMethod.releaseConnection();
}

}

}
}