[Java] 请求HTTP接口 →→→→→进入此内容的聊天室

来自 , 2019-03-29, 写在 Java, 查看 129 次.
URL http://www.code666.cn/view/b5dc4e5d
  1. String request_url = reg_api+"?"+"mobileNum="+telnumber+"&regSourceID="+agentid+"&clientIP="+ip;
  2.                           URL url = new URL(request_url);
  3.                       HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
  4.                       httpURLConnection.setDoOutput(true);
  5.                       httpURLConnection.setDoInput(true);
  6.                       httpURLConnection.setRequestMethod("GET");//提交类型
  7.                       httpURLConnection.connect();
  8.                       //获取返回值
  9.                       InputStreamReader  bis = new InputStreamReader(httpURLConnection.getInputStream(),"gb2312");
  10.                      
  11.                       int c = 0;
  12.                       while((c = bis.read()) != -1)
  13.                       {
  14.                        result=result+(char) c;  
  15.                       }

回复 "请求HTTP接口"

这儿你可以回复上面这条便签

captcha