我的服务的 UriTemplate 如下所示:
[WebGet(UriTemplate = "LoginUser/authorizationCode/{authorizationCode}/userId/{userId}/intend/{intend}/email/{email}")]
该函数如下所示:
public User LoginUser(string authorizationCode, string userId, string intend, string email)
我平时的电话是这样的:
http://localhost:60522/MyService.svc/json/LoginUser/authorizationCode/111222333/userId/0006435cec5aa5640639b5d08314bb989a43519/intend/yyy/email/abc@web.de
我的下一个任务是使意图和电子邮件参数可选。
所以我的电话必须在所有这些变体中工作:
http://localhost:60522/MyService.svc/json/LoginUser/authorizationCode/111222333/userId/0006435cec5aa5640639b5d08314bb989a43519/intend/yyy/email/abc@web.de
http://localhost:60522/MyService.svc/json/LoginUser/authorizationCode/111222333/userId/0006435cec5aa5640639b5d08314bb989a43519/intend/yyy
http://localhost:60522/MyService.svc/json/LoginUser/authorizationCode/111222333/userId/0006435cec5aa5640639b5d08314bb989a43519/email/abc@web.de
http://localhost:60522/MyService.svc/json/LoginUser/authorizationCode/111222333/userId/0006435cec5aa5640639b5d08314bb989a43519
如何编辑我的模板和函数以使其正常工作?