Check whether it is json data


    /**
     * 校验是否为JSON
     *
     * @param msg
     * @return
     */
    public static Boolean isJsonObject(String msg) {
    
    
        try {
    
    
            JSONObject.parseObject(msg);
        } catch (Exception e) {
    
    
            return false;
        }
        return true;
    }

Guess you like

Origin blog.csdn.net/weixin_43689953/article/details/111189933