java发送http请求
来源:互联网 发布:智能对话机器人软件 编辑:程序博客网 时间:2024/05/31 19:10
<span style="font-size:14px;">URL url = new URL("https://openapi.baidu.com/rest/2.0/iplib/query?access_token=30.631bf9d9173a40de6e6402eb756710b8.2592000.1390149393.3440595551-1735619");URLConnection connection = url.openConnection(); connection.setDoOutput(true); OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "utf-8");out.write("ip=222.36.223.19"); out.flush();out.close(); // 一旦发送成功,用以下方法就可以得到服务器的回应:String sCurrentLine;String sTotalString;sCurrentLine = "";sTotalString = "";InputStream l_urlStream;l_urlStream = connection.getInputStream(); BufferedReader l_reader = new BufferedReader(new InputStreamReader(l_urlStream));while ((sCurrentLine = l_reader.readLine()) != null) {sTotalString += sCurrentLine ; }</span>
0 0
- java 发送http请求
- JAVA发送HTTP请求
- Java发送Http请求
- java 发送http请求
- Java发送http请求
- java发送http请求
- java发送http请求
- java发送http请求
- java发送http请求
- java 发送http请求
- java发送http请求
- java发送http请求
- Java发送HTTP请求
- java发送http请求
- java发送http请求
- java发送http请求
- Java发送http请求
- java 发送http请求
- 判定鼠标点击某一控件
- SQL 事务 (存储过程与事务)
- 反序列化无法找到程序集(转载)
- 扩展软件包package feeds详细说明
- Java中的SoftReference
- java发送http请求
- LabVIEW关于数值显示控件增加单位的显示设置
- oracle 11g r2 RAC linux 6.4 x86_64 .
- C# 对象、文件与二进制串(byte数组)之间的转换
- 语音编码算法AMR NB , AMR WB 和AMR WB+的区别
- LEETCODE: Maximum Product Subarray
- 当json对象的key为数字时,在js中读取value的方法
- easyUI,重新渲染
- java中判断字符串是否是一个整数(转载)