,接口提交的内容{"content":"色情","version":2,"scene":3,"openid":"oF9gC5sVnaopI09UMBZS3NAqFDFg"},提交之后返回的内容,{"errcode":0,"errmsg":"ok","detail":[{"strategy":"keyword","errcode":0},{"strategy":"content_model","errcode":0,"suggest":"pass","label":100,"prob":90}],"trace_id":"66615018-08a94388-55c5cc37","result":{"suggest":"pass","label":100}}
你好,核实此为文字编码问题,传入的content显示为:\u8***\u6***,导致无法识别,请使用utf-8编码
因为我的项目是php,所以最终的解决方案是,修改了curl代码
public static function curlPost(string $url, array $data) { $postData = json_encode($data,JSON_UNESCAPED_UNICODE); $headers = array( 'Content-Type: application/json;charset=utf-8', 'Content-Length: ' . strlen($postData) ); $init = curl_init(); curl_setopt($init, CURLOPT_URL, $url); curl_setopt($init, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($init, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($init, CURLOPT_POST, true); curl_setopt($init, CURLOPT_RETURNTRANSFER, true); curl_setopt($init, CURLOPT_POSTFIELDS, $postData); curl_setopt($init, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($init); if (curl_errno($init)) { $output = curl_error($init); } curl_close($init); return json_decode($output, true); }
msg_sec_check接口有个scene值参数,切换一下试试呢