[英]Is it possible to remove quotations from AddParameter method RestSharp?
[英]RestSharp AddParameter
我想發出一個RestSharp請求,並且以下期望結果是:
tes = {
"paye": "0",
"type": "0",
"lines": [
{
"desc": "1",
"note": "10",
},
{
"desc": "2",
"note": "20",
},
{
"desc": "3",
"note": "30",
}
]
}
所以我發出這樣的請求:
var client = new RestClient(url);
var request = new RestRequest("tes", Method.POST);
request.AddParameter("paye", 0);
request.AddParameter("type", 0);
問題是如何完成lines []部分?
謝謝
創建類,如:
class tes {
//include all the properties here
}
序列化對象,並將其傳遞給帶有RestSharp請求的參數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.