Click here to Skip to main content
15,906,625 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello, I have a question concerns WebApi routing.
First of all is it possiple to route such kind of url in WebApi, see below:

..../api/physiciansregister/{id}/status

I need to rout that url to method which has, next signature:
C#
[HttpPost]
public void Status(int id, StatusInfo status)
{

}

information about status wiil be transfered in POST method and will be represented like JSON
Body:
{"Status":"Online"}

Status entity :
C#
class StatusInfo
{
string Status {get;set;}
}

Guys, any thoughts??)
Posted
v2

1 solution

 
Share this answer
 
Comments
Oleksandr Kulchytskyi 1-Aug-12 15:55pm    
Thanks for a link, but i have already read this article, and this article didn't preview any unstandart routing templates, only standart routing , like this:{controller}/{action}/{parameters}. This is not exactly what i need...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900