ASP.NET Web API, C#, Web Application

No HTTP resource was found that matches the request URI

We were getting a very silly error on deploying a webapi based service.

It was a GETAction

[Route("api/OCS/unbarmsisdn/{msisdnparam}")]
public IHttpActionResult UnbarMsisdn(string msisdn)
{

....

}

We were getting the following Error message:

No HTTP resource was found that matches the request URI

 

The problem was simple but can be easily missed.

Let’s look at the method definition again:

[Route("api/OCS/unbarmsisdn/{msisdnparam}")]
public IHttpActionResult UnbarMsisdn(string msisdn)
{

....

}

 

If you noticed there’s a difference between the Method parameter and the Route Decorator parameter. Both parameters should have the same name and you should be able to browse the method using the browser.

 

 

Advertisements
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s