【发布时间】:2013-03-08 07:48:16
【问题描述】:
这些我都试过了
和
Optional query string parameters in URITemplate in WCF
但是对我没有任何作用。这是我的代码:
[WebGet(UriTemplate = "RetrieveUserInformation/{hash}/{app}")]
public string RetrieveUserInformation(string hash, string app)
{
}
参数填满就可以了:
https://127.0.0.1/Case/Rest/Qr/RetrieveUserInformation/djJUd9879Hf8df/Apple
但如果app 没有价值则不起作用
https://127.0.0.1/Case/Rest/Qr/RetrieveUserInformation/djJUd9879Hf8df
我想让app 可选。如何做到这一点?
这是app没有值时的错误:
Endpoint not found. Please see the service help page for constructing valid requests to the service.
【问题讨论】: