[英]Data type restriction in REST Web service method
对于REST Webservice中URI中存在的输入参数必须为字符串的数据类型,是否存在任何限制?
我正在创建REST Web服务。 该方法具有输入参数ID,并且该参数也存在于URI中。 如果我将类型更改为整数,则在调用它时会生成错误。
Operation 'Get' in contract 'IService1' has a path variable named 'id' which does not have type 'string'. Variables for UriTemplate path segments must have type 'string'.
.net 4中的WCF REST无法执行此转换,但是WCF Web API可以。 http://wcf.codeplex.com
这与REST的任何约束无关,它纯粹是实现框架的限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.