Resolve the "HTTP 404" error when calling a Azure Mobile App Service custom API (.NET backend)

I got the "HTTP 404 - method not found" error message when calling a  a Azure Mobile App custom API (.NET backend) from the Universal Windows App (UWP). The custom API is defined as following:

        // GET api/GetStorageToken
        [HttpGet, Route("api/GetStorageToken/{contName}")]
        public async Task<StorageTokenViewModel> GetStorageToken(string containerName)
        {
                         .....
         }

I verified this issue and compared with the existing custom API which can be called successfully, and I found out the issue was the parameter name in the custom API different from the line above " [HttpGet, Route("api/GetStorageToken/{contName}")]", once I updated it to  [HttpGet, Route("api/GetStorageToken/{containerName}")], I can call this API successfully.

Comments

  1. The post is written in very a good manner and it contains much useful information.
    Mobile App Development Sydney

    ReplyDelete
    Replies
    1. Thx, let me know if you have any suggestions.

      Delete

Post a Comment

Popular posts from this blog

Top JavaScript courses helping you develop SPFx webPart with ReactJS and AngularJS

SharePoint 2013 error - "Application error when access /_vti_bin/client.svc"

Enable the Microsoft Power BI report file type (.pbix) in SharePoint Search