title: How to receive stream and object through post request in Web API?
body: <p>I'm currently developing a REST web service using Web API.</p>
  
  <p>Now I am trying to receive stream file and object through the post.</p>
  
  <p>When I sent it without the JobPosition object I received the file correctly, also when I sent the JobPosition without the file I received the JobPosition correctly.</p>
  
  <p>But when I sent the stream file and the object through the postman I receive the error.</p>
  
  <p>I would appreciate your help to understand if this is possible, and if so,  the direction that will help me.</p>
  
  <pre><code>public class JobPosition
  {
      public int Id { set; get; }
      public string Title { set; get; }
  }
  
  [HttpPost]
  [Route("Job")]
  public async Task&lt;bool&gt; Post(JobPosition job)
  {
      var multipartMemoryStreamProvider = new MultipartMemoryStreamProvider();
      await Request.Content.ReadAsMultipartAsync(multipartMemoryStreamProvider, new CancellationToken());
      var stream = await multipartMemoryStreamProvider.Contents[0].ReadAsStreamAsync();
      // implementaion
      return true;
  }
  </code></pre>
  
  <p>Postman request:
  <a href="https://i.stack.imgur.com/DE40f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DE40f.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/witb1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/witb1.png" alt="enter image description here"></a></p>
  
  <p>I tried all the possible combinations with the Content-Type with no success.</p>