【发布时间】:2011-05-13 09:46:28
【问题描述】:
我想在登录表单中连接。我发送连接信息。问题,识别后,网站进行重定向,当我使用方法 connection.getResponseCode() 测试我的 Object HttpsURLConnection 时,我有代码 302(HTTP 状态代码 302:临时重定向。)
- 重定向后如何使用我的对象连接获取 html 代码?
-
连接后如何使用我的连接在所有站点中导航?
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod("POST"); request.write("login=ll&password=pp"); request.flush(); request.close(); String line = ""; InputStreamReader isr = new InputStreamReader(connection.getInputStream()); //.... get string
谢谢你的回答:)
【问题讨论】:
标签: android http forms post login