L-F*_*our 3 c# rest wcf json get
如果我定义GET操作如下:
[OperationContract]
[WebInvoke(UriTemplate = "/findcategories", Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
FindCategoriesResponse FindCategories(FindCategoriesRequest request);
Run Code Online (Sandbox Code Playgroud)
但是当我尝试这个时,我得到了例外:
Operation 'FindCategories' in contract 'IComplaintService' uses GET, but also has body parameter 'request'. GET operations cannot have a body. Either make the parameter 'request' a UriTemplate parameter, or switch from WebGetAttribute to WebInvokeAttribute.
Run Code Online (Sandbox Code Playgroud)
在执行GET请求时,是否无法接受JSON对象作为参数?
谢谢
| 归档时间: |
|
| 查看次数: |
7003 次 |
| 最近记录: |