title: C# - Web Api pass object using Refit
body: <p><strong>Hello guys</strong></p>
  <p><em>I'am currently working in Xamarin and got stucked with basic operation. Iam trying to call my NetCore web API from Xamarin using Refit.</em></p>
  <p><em>The main problem is - I guess - that i want to pass object in paramater of call. The second problem could be that object has a List of enums as property.</em></p>
  <p><strong>Models:</strong></p>
  <pre><code>public class ArticleFilter
  {
      public List&lt;ArticleType&gt; Types { get; set; }
  
      public int? CarBrandId { get; set; }
  }
  
  public enum ArticleType
  {
      News = 1,
      SpecialOffer = 2,
      Service = 3,
  }
  </code></pre>
  <p><strong>Refit Interface:</strong></p>
  <pre><code>[Headers(&quot;Content-Type: application/json&quot;)]
  public interface IArticleApi
  {        
      [Get(&quot;/api/articles&quot;)]
      [Headers(&quot;Content - Type: application / json&quot;)]
      Task&lt;List&lt;Article&gt;&gt; GetAll(ArticleFilter filter);
  
      [Get(&quot;/api/articles/{id}&quot;)]
      Task&lt;ArticleDetail&gt; GetOne(int id);
  }
  </code></pre>
  <p><strong>Api controller:</strong></p>
  <pre><code>    [HttpGet]
      public async Task&lt;IActionResult&gt; GetAll([FromUri] ArticleFilterDto filter)
      {
          var articles = await _articleSectionService.GetAll(filter);
  
          if (articles == null)
          {
              return NotFound();
          }                
  
          return Ok(articles);
      }
  </code></pre>
  <p><strong>Postman call:</strong>
  <a href="https://i.stack.imgur.com/jE5YM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jE5YM.png" alt="enter image description here" /></a></p>
  <p><strong>Test calls from Xamarin view model:</strong></p>
  <pre><code>var filter = new ArticleFilter()
  {
      Types = new List&lt;ArticleType&gt; { ArticleType.News }
  };
                 
  var test = new List&lt;Article&gt;();
  test = await response.GetAll(filter);
  </code></pre>
  <p><em>Actually this one falls in exception</em> - <strong>415 - Unsupported media type</strong></p>
  <p>I came across their GitHub documentation but still no progress. Could some Superman help me please?</p>