title: Use request body for HTTP-DELETE method (ASP.NET Core WebAPI)
body: <p>According to the <a href="https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5" rel="nofollow noreferrer">RFC7231</a> standard:</p>
  <blockquote>
  <p>A payload within a DELETE request message has no defined semantics;
  sending a payload body on a DELETE request might cause some existing
  implementations to reject the request.</p>
  </blockquote>
  <p>In my example I am using ASP.NET Core WebApi and I would like to use a request body for an HTTP delete method. Fortunately it works, but I can't find any documentation that confirms that a request body is allowed / supported in ASP.NET Core WebApi.</p>
  <pre class="lang-cs prettyprint-override"><code>[HttpDelete(&quot;{id}&quot;)]
  public async Task&lt;ActionResult&lt;bool&gt;&gt; Delete(int id, [FromBody] AnyRequestBodyType body)
  {
      // Do some checks with the param &quot;body&quot; here.
      // If everything is OK, the resource will be deleted. 
      // Otherwise, I want to return an HTTP 4xx error. 
  }
  </code></pre>
  <p>Can I be sure that the API will work in future ASP.NET Core WebAPI releases?</p>
  <p>Do you have any other suggestions? I don't want to pass the parameter via query string because the <code>AnyRequestBodyType</code> is &quot;complex&quot; and a url-encoded request would no longer be readable or &quot;manually executeable&quot;.</p>