- 当前 Bug 的表现(可附上截图)
- 预期表现
{"errcode":87014,"errmsg":"内容含有违法违规内容"}
- 复现路径
- 提供一个最简复现 Demo
jar包:
public static void main(String[] args) {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Content-Type", "application/json;charset=UTF-8");
Map<String, String> params = new HashMap<>();
params.put("content", "完2347全dfji试3726测asad感3847知qwez到");
String parameter = JSON.toJSONString(params);
StringEntity se;
String result = null;
CloseableHttpResponse response;
HttpEntity entity;
try {
se = new StringEntity(parameter);
se.setContentType("text/json");
httpPost.setEntity(se);
response = client.execute(httpPost);
entity = response.getEntity();
result = EntityUtils.toString(entity, "UTF-8");
System.out.println(result);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
关于内容安全监测测试内容的问题反馈,开发者可以先确认以下问题:
1、是否采用post请求方式
2、是否已经把unicode转为utf-8
(参考链接:https://www.jb51.net/article/70251.htm)
3、内容安全监测主要是覆盖涉政,色情,违法这几类
已解决,百度之后换了一种Post调用:
https://zhidao.baidu.com/question/687447786330732684.html
这个怎么传的值啊