我是 laravel 和 vue 的初學者,當我向服務器發出 post 請求時遇到路由問題,它告訴我請求被重定向,我不知道問題出在哪里,因為 get 請求正常作業,請幫我
代碼
await this.form.post('/api/add_tramite/').then(response=>{
console.log(response.data);
this.fecthtramitesper();
this.close();
})
我在 laravel 的路線
Route::post('add_tramite',[tramiteController::class,'agregar_tramite']);
uj5u.com熱心網友回復:
您應該洗掉/URI 中的尾隨。
await this.form.post('/api/add_tramite').then(response=>{
許多服務器出于不同的原因將帶有斜杠的任何 url 重定向到沒有斜杠的版本,其中之一是 SEO。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/487864.html
