HER 303 See Other - HTTP_CLIENT_TIMEOUT 408 Request Time-Out - HTTP_UNAVAILABLE 503 Service Unavailable 对于这些响应码都做了处理: 1.返回null ``` if (followUp == null) { if (!forWebSocket) { streamAllocation.release(); } return response; } ``` 2.其他异常情况直接抛异常了 强调: `MAX_FOLLOW_UPS`字段, 表示最大的重定向次数 ``` /** * How many redirects and auth challenges should we attempt? Chrome follows 21 redirects; Firefox, * curl, and wget follow 20; Safari follows 16; and HTTP/1.0 recommends 5. */ private static final int MAX_FOLLOW_UPS = 20; ``` ``` if (++followUpCount > MAX_FOLLOW_UPS) { streamAllocation.release(); throw new ProtocolException("Too many follow-up requests: " + followUpCount); } ``` 这节就说到这,希望对大家有所帮助..... ![](https://img2018.cnblogs.com/blog/1312938/201908/1312938-20190829084746645-654895211.png) 大家可以关注我的微信公众号:「秦子帅」一个有质量、有态度的公众号! ![公众号](https://img2018.cnblogs.com/blog/1312938/201908/1312938-20190829084746832-730035128.jpg)
|