我有以下代码:
var Client = new System.Net.WebClient();
var Response = Client.UploadString("myurl", PostData);
按预期工作
我正在尝试使用Restsharp:
var Client = new RestClient("myurl");
var Request = new RestRequest(Method.POST);
Request.AddBody(PostData);
var Response = client.Execute(request);
不起作用,并且:
var Client = new RestClient("myurl");
var Request = new RestRequest(Method.POST);
Request.AddParameter("application/x-www-form-urlencoded; charset=UTF-8", PostData);
var Response = client.Execute(request);
也不起作用...... 我错过了什么?