java - 从 apache HttpResponse java 获取重定向 Uri

标签 java redirect httpresponse

图书馆员方法返回 apache HttpResponse 对象。我需要获取重定向 Uri。我怎样才能做到这一点?

最佳答案

我认为您可以使用Location header :

response.getLastHeader("Location").getValue();

关于java - 从 apache HttpResponse java 获取重定向 Uri,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13592530/

相关文章:

java - 正则表达式将匹配注释的 SQL 代码

java - 哪个 Java EE 服务器?

javascript - 在 angular2 中使用 HTTP 响应

Javafx SceneBuilder 不可共享或 derby 未在 .exe 中连接

java - 是否-XX :+UseSerialGC use main thread for GC

apache - 使用 mod_rewrite 从 example.com/dir 重定向到 www.example.com/dir

asp.net - 如何使用 SPA 中的参数重定向到同一应用程序的子域

c - C 中 dup2 与 Windows 套接字的等效项

java - 哪种方式更好地从 http 获取响应?为什么?

spring-boot - Spring Boot @ResponseStatus 不返回 HTTP 消息