java url get和post提交
来源:互联网 发布:火炬之光2for mac汉化 编辑:程序博客网 时间:2024/04/19 20:50
java url post提交
public static String sendPost(String url, String param) {String result = "";try {URL httpurl = new URL(url);HttpURLConnection httpConn = (HttpURLConnection) httpurl.openConnection();httpConn.setDoOutput(true);httpConn.setDoInput(true);PrintWriter out = new PrintWriter(httpConn.getOutputStream());out.print(param);out.flush();out.close();BufferedReader in = new BufferedReader(new InputStreamReader(httpConn.getInputStream()));String line;while ((line = in.readLine()) != null) {result += line;}in.close();} catch (Exception e) {System.out.println("没有结果!" + e);}return result;}java url get提交
public static String sendGet(String url, String param) {String result = "";try {String urlName = url + "?" + param;//URL U = new URL(urlName);URLConnection connection = U.openConnection();connection.connect();BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));String line;while ((line = in.readLine()) != null) {result += line;}in.close();} catch (Exception e) {System.out.println("没有结果!" + e);}return result;}
- java url get和post提交
- java模拟http get和post 提交
- java模拟http get和post 提交
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- URL编码以及GET和POST提交乱码解决方案
- url长度及get post提交方式
- java模拟get/post提交
- GET和POST提交数据
- 表单提交get和post
- Java获得GET和POST请求URL和参数列表
- Java 使用 URLConnection 模拟 Http Get和Post 提交
- STL-栈类模板
- STL-单向链表类模板
- 学习EF问题之EF无法映射只包含联合主键字段的表
- acm-D的小L
- acm-Binary String Matching
- java url get和post提交
- acm-对决
- [Qt教程] 第37篇 网络(七)TCP(一)
- acm-变态最大值
- acm-懒省事的小明
- acm-扩展欧几里得
- acm-Same binary weight
- acm-汉诺塔(三)
- acm-GoroSort