ares333/php-curl

为什么现在无法访问的连接不会返回任何东西,无法在代码中通过http_code判断该连接是否能正常访问$value = $args['url']; $http_code = $r['info']['http_code']; if($http_code !== 200){//判断能否请求 return $this->code('70001',['error_link'=>$value,'data'=>$value]); }

Closed this issue · 1 comments

$value = $args['url'];
$http_code = $r['info']['http_code'];
if($http_code !== 200){//判断能否请求
return $this->code('70001',['error_link'=>$value,'data'=>$value]);
}

网络不通不可能产生http_code,通过onFail回调处理此类问题