title: Why is DELETE method not allowed in simple API controller
body: <p>The basics work perfectly fine:</p>
  
  <ul>
  <li>GET index (/api/v1/pools)</li>
  <li>GET view (/api/v1/pools/1)</li>
  <li>POST create (/api/v1/pools)</li>
  </ul>
  
  <p>But when I attempt to use DELETE delete (/api/v1/pools/1), I get the following message:</p>
  
  <blockquote>
    <p>Method Not Allowed</p>
    
    <p>The requested method DELETE is not allowed for the URL
    /api/v1/pools/1.</p>
  </blockquote>
  
  <p>I even defined checkAccess() as an empty method, but nothing seems to help.</p>
  
  <p><strong>Setup</strong></p>
  
  <p>Controller:</p>
  
  <pre><code>class PoolController extends \yii\rest\ActiveController
  {
      public $modelClass = 'api\models\Pool';
  
      public function behaviors()
      {
          $behaviors = parent::behaviors();
          // authenticate by using an access token passed in the username authentication header
          $behaviors['authenticator'] = [
              'class' =&gt; HttpBasicAuth::className(),
          ];
          return $behaviors;
      }
  }
  </code></pre>
  
  <p>Config:</p>
  
  <pre><code>....
  'urlManager' =&gt; [
      'enablePrettyUrl' =&gt; true,
      'showScriptName' =&gt; false,
      //'enableStrictParsing' =&gt; true,
      'rules' =&gt; [
      [
          'class' =&gt; 'yii\rest\UrlRule', 
          'controller' =&gt; ['v1/pool'],
      ],
  ]
  ....
  </code></pre>
  
  <p><strong>Requests &amp; Responses</strong></p>
  
  <p><em>cURL DELETE request</em></p>
  
  <pre><code>curl -X DELETE \
    https://###/api/v1/pools/1 \
    -H 'Authorization: Basic dHBDMEUxNWVscl8tNlF6OFVYSGV5V0NydVBwdEp5elM6' \
    -H 'Content-Type: application/json' \
    -H 'cache-control: no-cache'
  </code></pre>
  
  <p><em>cURL repsponse</em></p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;405 Method Not Allowed&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Method Not Allowed&lt;/h1&gt;
  &lt;p&gt;The requested method DELETE is not allowed for the URL         
  /api/v1/pools/1.&lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p><em>wget DELETE request</em></p>
  
  <pre><code>wget --method DELETE 
    --header 'Content-Type: application/json'   
    --header 'Authorization: Basic dHBDMEUxNWVscl8tNlF6OFVYSGV5V0NydVBwdEp5elM6'   
    --header 'cache-control: no-cache'
    --output-document   - https://###/api/v1/pools/1
  </code></pre>
  
  <p><em>wget DELETE reponse</em></p>
  
  <pre><code>HTTP request sent, awaiting response... 405 Method Not Allowed
  2019-02-04 10:25:54 ERROR 405: Method Not Allowed.
  </code></pre>
  
  <p>For clarity, below the working request/response of another action (view) in the same controller is shown:</p>
  
  <p><em>cURL GET request</em></p>
  
  <pre><code>curl -X GET \
    https://###/api/v1/pools/1 \
    -H 'Authorization: Basic dHBDMEUxNWVscl8tNlF6OFVYSGV5V0NydVBwdEp5elM6' \
    -H 'cache-control: no-cache'
  </code></pre>
  
  <p><em>cURL GET response</em></p>
  
  <pre><code>{"success":true,"data":{
      "id":1,
      "user_id":1,
      "name":"pool",
      ....
      "created_at":"2019-01-31 20:00:00"
  }}
  </code></pre>
  
  <p>After further fiddling, I found out it will always return this message, even if I intentionally cause an internal error in the controller or the api main config. The working actions do indicate an internal error occurred. The request does not even show up in the debugger, only GET, POST and HEAD get that far.</p>