jqueryでajaxを書いているのですが、どうもうまくいきません。ちなみにlaravelで書いてます。
$.ajax({ type:"POST", url: 'http://localhost:8000/ec_option', data: { "name": 'test' }, success: function(r_data){ console.log(r_data); } });
送信先(コントローラー) public function option(Request $request) { $result = $request->name; echo $result; } 一応ルート Route::post('/ec_option', 'TestController@option');
エラーはresponded with a status of 500 (Internal Server Error)が返ってきてます。何が原因かわかるかたいますでしょうか
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。