Commit 3e0c6c4c authored by 周健威's avatar 周健威

添加接口

parent 4a994ce4
...@@ -166,8 +166,15 @@ public class LmyxmonitorimageController extends BaseController<LmyxmonitorimageB ...@@ -166,8 +166,15 @@ public class LmyxmonitorimageController extends BaseController<LmyxmonitorimageB
headers.put("sign", sign); headers.put("sign", sign);
httpRequest.addHeaders(headers); httpRequest.addHeaders(headers);
// 直接在这里设置跟随重定向就可以了
httpRequest.setFollowRedirects(true);
httpRequest.setMaxRedirectCount(5);
// String result = httpRequest.execute().body(); // String result = httpRequest.execute().body();
final HttpResponse response = httpRequest.executeAsync(); HttpResponse response = httpRequest.execute();
// if (response.isFollowRedirect() && response.getRedirectCount() > 0) {
// String redirectUrl = request.getUrl();
// System.out.println("重定向后的URL: " + redirectUrl);
// }
if (false == response.isOk()) { if (false == response.isOk()) {
throw new HttpException("Server response error with status code: [{}]", response.getStatus()); throw new HttpException("Server response error with status code: [{}]", response.getStatus());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment