WCF and optional parameters

前端 未结 3 873
无人及你
无人及你 2020-12-15 20:27

I just started using WCF with REST and UriTemplates. Is it now possible to use optional parameters?

If not, what would you guys recommend I do for a system that has

3条回答
  •  伪装坚强ぢ
    2020-12-15 20:51

    You have to use "?" followed by "/" in your Url.

    example:

    [WebGet(UriTemplate = "GetSample/?OptionalParamter={value}")]
        string GetSample(string part1);
    

提交回复
热议问题