title: How to post model and file in API controller using postman?
body: <p>I am working on a <a href="https://en.wikipedia.org/wiki/ASP.NET#Extension" rel="nofollow">Web API</a> project and I'm unable to post both model and file simultaneously at a time. Postman throws an exception:</p>
  
  <blockquote>
    <p>System.Net.Http.UnsupportedMediaTypeException"</p>
  </blockquote>
  
  <p>How can I fix this problem?</p>
  
  <p>My code is looking like:</p>
  
  <pre><code>[HttpPost]
  [Route("Appeal")]
  public IHttpActionResult SaveAppeal(AppealModel model)
  {
      try
      {
          var file = HttpContext.Current.Request.Files.Count &gt; 0 ?
          HttpContext.Current.Request.Files[0] : null;
  
          var AppealResponses = _ContactService.SaveAppeals(model);
          return Ok(new { AppealResponses });
      }
      catch (Exception ex)
      {
          _log.ErrorFormat("Error in AppealResponses. Error:{0}", ex.Message);
          _log.Error(ex);
          throw;
      }
  }
  </code></pre>