static async Task PostData(string url="https://leancloud.cn/1.1/rtm/messages"){
using(HttpClient client=new HttpClient()){
client.DefaultRequestHeaders.Add("X-LC-Id", "8998989889-gzGzoHsz");
client.DefaultRequestHeaders.Add("X-LC-Key", "898098,master");
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
//client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var content = new FormUrlEncodedContent(new Dictionary()
{
{"from_peer", "568cb66400b009a331c556d5"},
{"message", "helloworld-099898"},
{"conv_id", "568cb67b9accde5e1980ab2d"},
{"transient", "false"}
});
Uri serviceReq = new Uri(url);
await client.PostAsync(serviceReq,content).ContinueWith((requestTask)=>{
HttpResponseMessage response=requestTask.Result;
response.Content.ReadAsStringAsync().ContinueWith((readTask)=>{
Console.WriteLine(readTask.Result);
});
});
}
}
报错提示:{"code":1,"error":"请提供 from_peer。"}
请问如何解决,谢谢