HTTP 客户端 链接超时 Time Out 该如何判断?
通常使用 try catch ;
看HTTP客户端文档 没有关于超时的!
// 如果状态码在 200 - 300之间
$response->successful();
// 如果状态码 大于 400
$response->failed();
// 如果状态码是 400 层级的错误(401,402,403,404……)
$response->clientError();
// 如果状态码是 500 层级的错误
$response->serverError();
推荐文章: