webman 請求URL如何設(shè)置不區(qū)分大小寫
比如請求 http://127.0.0.1:8787/api/index/index
http://127.0.0.1:8787/Api/Index/index
也能請求,現(xiàn)在返回404
默認路由不區(qū)分大小寫,手動設(shè)置路由估計區(qū)分大小寫
為什么webman的url是區(qū)分大小寫的?
//a: 因為webman的路由是由fast-route來實現(xiàn)的,fast-route的路由是區(qū)分大小寫的。
// 如果需要忽略大小寫,可以在Route::any()中加上第四個參數(shù)true,表示忽略大小寫。
// Route::any('/index.html', [app\controller\IndexController::class, 'index'], 'index', true);
// 如果需要全部忽略大小寫,可以在config\route.php中加上第四個參數(shù)true,表示忽略大小寫。
// Route::any('/index.html', [app\controller\IndexController::class, 'index'], 'index', true);
// Route::any('/Index.html', [app\controller\IndexController::class, 'index'], 'index', true);