6
スリムフレームワークで書かれたREST APIを使用しようとしています。
&投稿方法は問題なく動作します。しかし、DELETE要求は機能しません。私は "メソッドを削除アクセス制御許可メソッドでは許可されていません"
私はすでにヘッダーにOPTIONSとDELETEを許可しています。以下のコードを参照してください。
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
$app->options('/(:name+)', function() use($app) {
$response = $app->response();
$app->response()->status(200);
$response->header('Access-Control-Allow-Origin', '*');
$response->header('Access-Control-Allow-Headers', 'Content-Type, X-Requested-With, X-authentication, X-client');
$response->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
});
このリクエストに失敗した原因は何ですか?