I'm hoping to pass a URI string into a GET method in my APIController inhering class. I've tried putting it in the Content as raw text, and as a string param without luck. I've made a model to pass in as a param:
namespace ServerDock.Models.Web
{
using System.Runtime.Serialization;
[DataContract]
public partial class UriWeb
{
[DataMember]
public string Uri_String { get; set; }
public UriWeb() { }
}
}
Now my Controller's function is as follows:
[Route("file", Name = "Download")]
[HttpGet]
public async Task<IHttpActionResult> DownloadFile([FromBody] UriWeb uri)
With a Postman call whos JSON body is as follows:
{
"Uri_String":"https://mysite.windows.net/files/ec0a30c8-265d-4c94-b176-387004f5f566-.jpg"
}
My breakpoint in the controller function is never hit, and I get the error: The request body is incomplete.
Any idea what I'm doing wrong?