私は安らかなAPIに慣れていませんが、問題に遭遇しました.deleteメソッドでdestroyをリクエストし、postメソッドでstoreをリクエストすると、両方とも500エラーが返されます.しかし、getメソッドを使用してインデックスと表示をリクエストすると、どちらも問題ありません.何が問題ですか?ここに私のコードとリクエストがあります:
http://***.com/RestfulPrac/public/customers/10000001 を削除
http://***.com/RestfulPrac/public/customers/10000001 を取得します
投稿 http://***.com/RestfulPrac/public/customers
class CustomersController extends Controller
{
public function index(){
$customersInfo = customers::all();
return $customersInfo;
}
public function show($cust_id){
$customer = customers::where('cust_id',$cust_id)->first();
return $customer;
}
public function store()
{
echo "store";
}
public function destroy()
{
return "success";
}
}
Route::resource('customers','CustomersController');
Apache access.log : "DELETE /RestfulPrac/public/customers/1000000001 HTTP/1.0" 500 20246 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML、Gecko など) Chrome/50.0.2661.102サファリ/537.36"
Apache error.log: [Thu Jun 02 09:09:24.324782 2016] [negotiation:error] [pid 4328:tid 1676] [client 127.0.0.1:4940] AH00690: 受け入れられないバリアント: D:/XAMPP/apache/エラー/HTTP_NOT_FOUND.html.var
laravel.log: local.ERROR: exception 'Illuminate\Session\TokenMismatchException' in F:\PhpstormProjects\RestfulPrac\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php:67 スタック トレース:
誰かが私を助けることができれば、私はそれを感謝します!