写一段java主动发送请求的示例代码

String url = "http://example.com/example.php";try { URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection();

// optional default is GET con.setRequestMethod("GET");

//add request header con.setRequestProperty("User-Agent", USER_AGENT);

int respon

猜你喜欢

转载自blog.csdn.net/weixin_35757531/article/details/129548005
今日推荐