The idea is that there will be an external object (SharePoint) that will call my WebAPI and transfer to the PDF file, as well as some additional metadata about this PDF file. I went in cycles on how to create a signature of the Web API method. Here is what I still have:
public class IssueController : ApiController
{
private TestEntities db = new TestEntities(HelperClasses.ConnectionStringHelper.GetConnectionString());
[HttpPost]
public HttpResponseMessage SavePdf(Article a)
{
}
}
My desire would be to do something like:
public class IssueController : ApiController
{
private TestEntities db = new TestEntities(HelperClasses.ConnectionStringHelper.GetConnectionString());
[HttpPost]
public HttpResponseMessage SavePdf(Article a, HttpPostedFileBase file)
{
}
}
But I'm not sure if using WebAPI exactly do this.
QUESTION . How to define a WebAPI method capable of receiving PDF data and some additional metadata as a request POSTfrom an external object?
source
share