結(jié)合設計經(jīng)驗與營銷實踐,提供有價值的互聯(lián)網(wǎng)資訊
發(fā)布日期:2022-03-26瀏覽次數(shù):1125 來源:福州網(wǎng)站建設
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
路由設置為:Route::get('api/v1/:function', 'api/:function');
不知道是BUG還是我哪里設置錯了?$url = 'http://localhost:10000/index.php/api/v1/iplocation?ip=14.153.11.23';
echo get_http_code($url); // 顯示為404
function get_http_code($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true); // remove body
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$head = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $httpCode;
}
以上是由福州網(wǎng)站建設的小編為你分享了"tp6問題加了路由地址,響應碼都是404的問題"文章,如果你在這方面有什么問題,隨時聯(lián)系我們