HttpURLConnection
public void setinstancefollowredirects(boolean followredirects)
设置此 httpurlconnection 实例是否应该自动执行 http 重定向(响应代码为 3xx 的请求)。
默认值来自 followredirects,其默认情况下为 true。
参数:
followredirects - 指示是否执行 http 重定向的 boolean 值。
public static void HttpURLConnection.setFollowRedirects(boolean followRedirects)
设置所有的http连接是否自动处理重定向;
参数:
设置成true,系统自动处理重定向;设置成false,则需要自己从http reply中分析新的url
自己重新连接。
还没有评论,来说两句吧...