laravel 前端有?id=12這麼一個api請求,請教路由怎麼寫

jinduo發表於2021-12-24

前端請求:http://***.test/api/v1/list?id=17

Route::get('/api/v1/list?id={id}', [\App\Http\Controllers\SignController::class, 'list']);

提示這樣的錯誤

Oops! An Error Occurred
The server returned a "405 Method Not Allowed".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章