title: Using ASP.NET WebAPI v2, how do I POST PDF data in a WebAPI method?
body: <p>The idea is that there will be an external entity (SharePoint) that will call my WebAPI and pass in a PDF file as well as some extra, metadata information about that PDF file.  I'm stuck on how to construct the signature of the Web API method.  Here's what I have so far:</p>
  
  <pre><code>public class IssueController : ApiController
  {
      private TestEntities db = new TestEntities(HelperClasses.ConnectionStringHelper.GetConnectionString());
  
      [HttpPost]
      public HttpResponseMessage SavePdf(Article a)
      {
          // save the PDF to a file share &amp; metadata to the SQL database
      }
  }
  </code></pre>
  
  <p>My inclination would be to do something like:</p>
  
  <pre><code>public class IssueController : ApiController
  {
      private TestEntities db = new TestEntities(HelperClasses.ConnectionStringHelper.GetConnectionString());
  
      [HttpPost]
      public HttpResponseMessage SavePdf(Article a, HttpPostedFileBase file)
      {
          // save the PDF to a file share &amp; metadata to the SQL database
      }
  }
  </code></pre>
  
  <p>But, I'm not sure with WebAPI how to exactly do this. </p>
  
  <p><strong>QUESTION</strong>: How would I define a WebAPI method capable of accepting PDF data &amp; some extra metadata as a <code>POST</code> request from an external entity?</p>