Dean Friedland
Dean Friedland

Reputation: 803

Web Api Post request with one parameter not working

I cannot figure out why I am getting a 404 for this request. I am pretty new to Web Api routing but I thought this was correct. Anyone have an idea of what the issue is. I have been on this for about an hour and a half. Thank you!

Routing Config:

        public override void RegisterArea(AreaRegistrationContext context)
        {
            RouteTable.Routes.MapHttpRoute(
                "japiClientOnboarding",
                "japi/clientOnboarding/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }

Controller Action:

        [System.Web.Http.HttpPost]
        public HttpResponseMessage createClientFromProspect(long prospectId)
        {
            ........
        }

My call via Postman:

enter image description here

Upvotes: 0

Views: 56

Answers (1)

Dean Friedland
Dean Friedland

Reputation: 803

Figured it out. Had to do with my parameter name not being "whitelisted" in our system. Very frustrating!

Upvotes: 1

Related Questions