unsupported media type error when posting to aspnetcore api from angular using $http.delete
<p>I'm getting a 415 http error result when posting to a aspnetcore api.
This doesn't happen if my endpoint is marked with [HttpPost] instead of [HttpDelete]</p>

<p>In the aspnetcore api controller:</p>

<pre><code>[HttpDelete]
public async Task&lt;IActionResult&gt; Delete([FromBody]EntityViewModel vm)
{
</code></pre>

<p>In the angular controller:</p>

<pre><code> var obj = new Object();
 obj.atr1 = 1;
 obj.atr2 = 2 ;

 $http.post(route, obj)
    .then(function (response) {
</code></pre>

<p>EntityViewModel.cs </p>

<pre><code>public class EntityViewModel
    {
        public int Atr1 { get; set; }
        public int Atr2 { get; set; }
    }
</code></pre>