- 敏感词检测msg_sec_check无效,提示 {"errcode":0,"errmsg":"ok"
使用HTTPS 调用,发现输入什么关键字都返回 0,ok代码如下:这个需要转格式? public JsonResult> PostmsgSecCheck(Content content) { var ret = Security.msgSecCheck(content.Body); return JsonResult(new { errcode = ret.errcode, errmsg = ret.errmsg }); } public dynamic msgSecCheck(string content) { var msg = new { content }; string jsonString = HttpHelper.HttpPost(url, JsonConvert.SerializeObject(msg)); var json = JsonConvert.DeserializeObject(jsonString); return new { json.errcode, json.errmsg }; } public static string HttpPost(string Url, string postDataStr) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); request.Method = "POST"; //request.ContentType = "application/x-www-form-urlencoded"; request.ContentType = "application/json"; request.ContentLength = postDataStr.Length; StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII); writer.Write(postDataStr); writer.Flush(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string encoding = response.ContentEncoding; if (encoding == null || encoding.Length < 1) { encoding = "UTF-8"; //默认编码 } StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding)); string retString = reader.ReadToEnd(); return retString; }
2020-09-29 - 预览 、调试、上传 都卡在哪里,也没有错误提示,这个是什么问题?
预览 、调试、上传 都卡在哪里,也没有错误提示,这个是什么问题?[图片]
2020-09-28