请问如何使用RestSharp向接口发送无参数名的数据
请问哪位大侠知道啊,请不吝赐教啊
已解决,上代码
var client = new RestClient(uri);
var request = new RestRequest(method, Method.POST);
//传递无参数名的参数例如: "eyJhZGxIn0="(加密后的字符串)
request.AddParameter("application/json; charset=utf-8", paramData, ParameterType.RequestBody);
// execute the request
IRestResponse response = client.Execute(request);
//连不上接口时,不会触发catch异常,但ErrorException字段不为NULL
if (response.ErrorException != null)
throw response.ErrorException;
string content = response.Content; // raw content as string
return content;
你自己再看看那个代码,或者是百度一下