Codeigniter Rest api 在 http 或 http 情况下不工作
Codeigniter Rest api not working in http or http case
我正在开发 codeigniter api,完成后 API 我已将代码上传到服务器并且所有 api 都在工作,但突然 api 显示错误“未知方法”我正在使用“http://example.com/app/ws”所以出现错误,如果我使用“https://example.com/app/ws”api 工作我需要api 如果我使用 http 或 https 它应该可以工作,因为有一段时间 ssl 证书在那个 https nworking 中过期,如果 https 中的域那么 http 不工作我需要 http 或 https 都应该工作如何使用 .htacess 执行此操作我附上我的.htaccess 文件中的代码
RewriteEngine on
RewriteCond !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
您是否试图从另一个 CodeIgniter 应用程序获取 api?
如果是,您可以在第二个应用程序上尝试此操作:
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$json = file_get_contents('http://thelink', false, stream_context_create($arrContextOptions));
$data = json_decode($json, true);
我正在开发 codeigniter api,完成后 API 我已将代码上传到服务器并且所有 api 都在工作,但突然 api 显示错误“未知方法”我正在使用“http://example.com/app/ws”所以出现错误,如果我使用“https://example.com/app/ws”api 工作我需要api 如果我使用 http 或 https 它应该可以工作,因为有一段时间 ssl 证书在那个 https nworking 中过期,如果 https 中的域那么 http 不工作我需要 http 或 https 都应该工作如何使用 .htacess 执行此操作我附上我的.htaccess 文件中的代码
RewriteEngine on
RewriteCond !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
您是否试图从另一个 CodeIgniter 应用程序获取 api? 如果是,您可以在第二个应用程序上尝试此操作:
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$json = file_get_contents('http://thelink', false, stream_context_create($arrContextOptions));
$data = json_decode($json, true);