title: How to allow an empty request body for a reference type parameter?
body: <p>I'm Building an .Net Core api controller, I would like to allow users to send <code>GET</code> requests with or without the <code>MyRequest</code> class as a parameter, so the calling the method with <code>Get(null)</code> for example will be Ok.</p>
  
  <p><code>GET api/myModels</code> requests method:</p>
  
  <pre><code>[HttpGet]
  public ActionResult&lt;IEnumerable&lt;MyModel&gt;&gt; Get(MyRequest myRequest)
  {
      if (myRequest == null)
          myRequest = new myRequest();
  
      var result = this._myService.Get(myRequest.Filters, myRequest.IncludeProperties);
      return Ok(result);     
  }
  </code></pre>
  
  <p><code>MyRequest</code> class:</p>
  
  <pre><code>public class MyRequest
  {
      public IEnumerable&lt;string&gt; Filters { get; set; }
      public string IncludeProperties { get; set; }
  }
  </code></pre>
  
  <p>When I refer to this <code>Get</code> method using <code>Postman</code> with Body, it works.
  The problem is, when I keep the body empty (to call the Get method with a <code>MyRequest</code> null object as a parameter like <code>Get(null)</code>) I'm getting this <code>Postman</code>'s massage of:</p>
  
  <blockquote>
    <p>"A non-empty request body is required."</p>
  </blockquote>
  
  <p>There is a similar <a href="https://stackoverflow.com/questions/53462958/call-asp-net-core-web-api-from-postman?rq=1">question</a>, but there, the parameters are value type.</p>