I tried the following code:
[OperationContract]
[WebInvoke(UriTemplate="/Users/Register/{user}")]
void Register(User user);
But when I try to run this, it tells me that the UriTemplate should only contain strings. What should I do if I need to pass an object to my method, as in this case, the User object for my Register method.
If I change the WebInvoke attribute to:
[WebInvoke(UriTemplate="/Users/Register/")]
Browswer displays an error Method not allowwhen I try to go to http: // localhost: 8000 / Users / Register , for example
source
share