HttpPostTest 接口获取 重定向
来源:互联网 发布:驱蚊软件下载 编辑:程序博客网 时间:2024/06/03 08:07
public class HttpPostTest { void testPost(String urlStr) { try { URL url = new URL(urlStr); URLConnection con = url.openConnection(); con.setDoOutput(true); con.setRequestProperty("Pragma:", "no-cache"); con.setRequestProperty("Cache-Control", "no-cache"); con.setRequestProperty("Content-Type", "text/xml"); OutputStreamWriter out = new OutputStreamWriter(con .getOutputStream()); String xmlInfo = getXmlInfo(); out.write(new String(xmlInfo.getBytes("ISO-8859-1"))); out.flush(); out.close(); BufferedReader br = new BufferedReader(new InputStreamReader(con .getInputStream())); String line = ""; int i=0; for (line = br.readLine(); line != null; line = br.readLine()) { System.out.println(i+++"条----"+line); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); ; } }
0 0
- HttpPostTest 接口获取 重定向
- HTTP请求重定向的接口,获取该接口重定向地址
- Python接口-重定向
- 获取重定向地址
- HttpUrlConnection访问重定向接口
- PHP调用接口重定向
- HttpClient获取重定向URL
- C# 获取url 状态,获取重定向
- JS 获取当前域名 重定向请求
- HttpURLConnection重定向,获取及设置cookie
- HttpClient获取重定向地址的代码
- VC网络重定向网址获取
- HttpClient获取重定向前response
- Java 获取网络重定向URL
- 获取重定向后的url
- CURL获取 URL Location:重定向
- python 重定向获取真实url
- HttpClient get请求取消自动重定向,并获取重定向的地址。
- 关于机器学习应用的资料整理
- Android--推送机制实现原理(一)
- 上传文件
- Keyless SSL: The Nitty Gritty Technical Details
- 多态之虚表剖析2
- HttpPostTest 接口获取 重定向
- vim重新编译生成支持lua
- Xposed也要热更新
- 拓扑排序
- Android进阶——安卓调用ESC/POS打印机打印
- SignalR Self Host+MVC等多端消息推送服务(3)
- 拓扑排序(Java实现)
- log4j 优化高配置
- Java反射机制创建对象