请问如何使用RestSharp向接口发送无参数名的数据
请问哪位大侠知道啊,请不吝赐教啊
2条回答 默认 最新
沫沫1023 2017-05-25 09:13关注已解决,上代码
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;本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报