1
使用RestSharp 105.2.3RestSharp - 序列化一個@符號
我所說到的API需要使用一個JSON給全身,但有@c
符號作爲字段名稱的一部分。這在C#中當然是非法的,所以我不能只使用像下面這樣的動態對象。
有沒有辦法讓字段名稱中的"@c"
?
var client = new RestClient("https://aaa.bbb.com");
var request = new RestRequest(Method.POST);
request.AddJsonBody(new
{
@c=".Something",
username="johnsmith"
});
你試過從這個[文章]方法(http://stackoverflow.com/questions/6312970/restsharp-json-parameter-發佈)? –
我的方法有效嗎? – johannesp