Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass email as a parameter at the end of URL in ASP.NET MVC web API?

Tags:

How to pass email as a parameter at the end of URL in ASP.NET MVC web API?

like below:

test.com/api/sales/getcustomerorders/[email protected] 

I want to pass the email address as a parameter to the getcustomerorders action.

we can pass using query string. But I want to format the url like above.

Thanks.

like image 960
User0106 Avatar asked Oct 11 '12 13:10

User0106


1 Answers

In WebApiConfig make the route as "/{email}/". The end "/" will prevent you from getting No HTTP resource was found that matches the request URI ...

like image 146
Damitha Avatar answered Oct 21 '22 07:10

Damitha