有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java HttpPost到asp服务器(HTML格式)

使用HttpURLConnection并向服务器发送邮件,我获得了带有位置头的重定向页面。状态代码302,因此我必须使用此信息继续重定向。(这里似乎一切都很好……至少对我来说是这样)

08-03 09:45:11.662: INFO/System.out(1664): <html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://website/mobile/(X(1)S(sf3dah5520rblujg4z2n0n55))/Login.aspx?ReturnUrl=%2fsyspower3%2fmobile%2fDefault.aspx&amp;AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>
08-03 09:45:11.662: INFO/System.out(1664): Status code - 302
08-03 09:45:11.672: INFO/System.out(1664): location : [http://website/mobile/(X(1)S(sf3dah5520rblujg4z2n0n55))/Login.aspx?ReturnUrl=%2fsyspower3%2fmobile%2fDefault.aspx&AspxAutoDetectCookieSupport=1]
08-03 09:45:11.672: INFO/System.out(1664): x-powered-by : [ASP.NET]
08-03 09:45:11.672: INFO/System.out(1664): content-type : [text/html; charset=utf-8]
08-03 09:45:11.672: INFO/System.out(1664): content-length : [282]
08-03 09:45:11.672: INFO/System.out(1664): date : [Wed, 03 Aug 2011 09:45:00 GMT]
08-03 09:45:11.672: INFO/System.out(1664): server : [Microsoft-IIS/7.5]
08-03 09:45:11.672: INFO/System.out(1664): location found: http://website/mobile/(X(1)S(sf3dah5520rblujg4z2n0n55))/Login.aspx?ReturnUrl=%2fsyspower3%2fmobile%2fDefault.aspx&AspxAutoDetectCookieSupport=1

在这之后,如果我在普通浏览器中使用此链接,我可以进入服务器而无需登录,因此实际上,我应该使用此链接在登录后发布帖子并获取服务器内部的信息。(如果我在浏览器中使用它,它实际上可以做到这一点)

问题: 如果我用新的发布到已使用新位置的服务器,我将再次进入登录屏幕。 我应该为新的请求使用cookies吗?或者我有什么问题


共 (0) 个答案