【发布时间】:2016-09-05 19:18:27
【问题描述】:
对于 RESTful API,我需要使用 get 来检索列表,但是我想传递以下一些复杂参数作为方法的输入。
{
"Filters": [
{
"FieldName": "sample string 1",
"FieldValue": "sample string 2"
},
{
"FieldName": "sample string 1",
"FieldValue": "sample string 2"
}
],
"SortField": "sample string 1",
"SortValue": 0,
"Page": 2,
"PageSize": 3
}
由于我不能在 Get 方法中使用 RequestBody,因此如何传递参数,如果我将其设为 Post,它将不是 RESTful。
【问题讨论】:
-
不使用 url 编码的查询还有一个问题,在响应中返回“下一个”链接并不容易(可能吗?)。
标签: json rest asp.net-web-api2