被转义的 JSON 字符的格式化
1、一段 JSON 结构的且被转义的字符。如图1
{ "timestamp": 1631780119.542232, "url": "http://apimerge.chinamcloud.com?&com_id=1&tenantid=59b8833e28c267350c8c0fa5d890c4a4&cms_app_id=268&number=10&page=1&host=", "param": [], "header": [ "x-request-id:30922c2548c2b85ee201b1e8cc7639e7" ], "result": "{\"contentList\":[{\"id\":\"4228588d-06ba-4587-b234-28414db8f860\",\"title\":\"\\u522e\\u522e\\u522e\",\"shortTitle\":\"\",\"shareTitle\":\"\",\"summary\":\"\",\"shareImage\":\"\",\"shareOpen\":false,\"showNum\":0,\"model\":\"9\",\"modelName\":\"scratch\",\"isComment\":0,\"pulishDate\":1625673600,\"slidePic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/\",\"listPic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/\",\"htmlUrl\":\"http:\\/\\/morefun.chinamcloud.com\\/act\\/scratch\\/index.html?act_id=4228588d-06ba-4587-b234-28414db8f860&group_id=59b8833e28c267350c8c0fa5d890c4a4\",\"wechatUrl\":\"\",\"startTime\":1625673600,\"endTime\":1637769600,\"contentSummary\":\"\",\"tag\":2},{\"id\":\"649b79cb-fd65-4d4f-8b6c-349131f8a5ff\",\"title\":\"\\u7b2c\\u4e8c\\u4e2a\\u6d3b\\u52a8\",\"shortTitle\":\"\",\"shareTitle\":\"aaaa\",\"summary\":\"aa\",\"shareImage\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/tmp\\/20210708\\/09\\/20210708094246136048.png\",\"shareOpen\":true,\"showNum\":0,\"model\":\"9\",\"modelName\":\"vote\",\"isComment\":0,\"pulishDate\":1625673600,\"slidePic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210708\\/09\\/20210708094307567894.png\",\"listPic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210708\\/09\\/20210708094307567894.png\",\"htmlUrl\":\"http:\\/\\/morefun.chinamcloud.com\\/act\\/custom-built-vote-screen\\/index.html?act_id=649b79cb-fd65-4d4f-8b6c-349131f8a5ff&group_id=59b8833e28c267350c8c0fa5d890c4a4\",\"wechatUrl\":\"\",\"startTime\":1625673600,\"endTime\":1628092800,\"contentSummary\":\"\",\"tag\":2},{\"id\":\"b0463ff2-3429-4a7c-9aad-bc1bddc3bf81\",\"title\":\"\\u7b2c\\u4e00\\u4e2a\\u6d3b\\u52a8\",\"shortTitle\":\"\",\"shareTitle\":\"\\u6ca1\\u6709\\u63cf\\u8ff0\\u624d\\u662f\\u771f\\u6b63\\u7684\\u63cf\\u8ff0\",\"summary\":\"\\u6ca1\\u6709\\u63cf\\u8ff0\\u624d\\u662f\\u771f\\u6b63\\u7684\\u63cf\\u8ff0\",\"shareImage\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/tmp\\/20210707\\/10\\/20210707105510041579.png\",\"shareOpen\":true,\"showNum\":0,\"model\":\"9\",\"modelName\":\"vote\",\"isComment\":0,\"pulishDate\":1625587200,\"slidePic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210707\\/10\\/20210707105550856930.jpg\",\"listPic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210707\\/10\\/20210707105550856930.jpg\",\"htmlUrl\":\"http:\\/\\/morefun.chinamcloud.com\\/act\\/vote-screen\\/index.html?act_id=b0463ff2-3429-4a7c-9aad-bc1bddc3bf81&group_id=59b8833e28c267350c8c0fa5d890c4a4\",\"wechatUrl\":\"\",\"startTime\":1625587200,\"endTime\":1632499200,\"contentSummary\":\"\",\"tag\":2}],\"returnCode\":100,\"number\":10,\"currentPage\":1,\"totalPage\":0,\"total\":0,\"com_id\":1,\"serverTime\":1631780097,\"returnDesc\":\"\\u6210\\u529f\"}" }
2、想将 result 字段的值进行 JSON 格式化。打开网址:https://www.bejson.com/ 。复制内容至在线工具中,然后点击 去除转义。如图2
去除转义前:
{\"contentList\":[{\"id\":\"4228588d-06ba-4587-b234-28414db8f860\",\"title\":\"\\u522e\\u522e\\u522e\",\"shortTitle\":\"\",\"shareTitle\":\"\",\"summary\":\"\",\"shareImage\":\"\",\"shareOpen\":false,\"showNum\":0,\"model\":\"9\",\"modelName\":\"scratch\",\"isComment\":0,\"pulishDate\":1625673600,\"slidePic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/\",\"listPic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/\",\"htmlUrl\":\"http:\\/\\/morefun.chinamcloud.com\\/act\\/scratch\\/index.html?act_id=4228588d-06ba-4587-b234-28414db8f860&group_id=59b8833e28c267350c8c0fa5d890c4a4\",\"wechatUrl\":\"\",\"startTime\":1625673600,\"endTime\":1637769600,\"contentSummary\":\"\",\"tag\":2},{\"id\":\"649b79cb-fd65-4d4f-8b6c-349131f8a5ff\",\"title\":\"\\u7b2c\\u4e8c\\u4e2a\\u6d3b\\u52a8\",\"shortTitle\":\"\",\"shareTitle\":\"aaaa\",\"summary\":\"aa\",\"shareImage\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/tmp\\/20210708\\/09\\/20210708094246136048.png\",\"shareOpen\":true,\"showNum\":0,\"model\":\"9\",\"modelName\":\"vote\",\"isComment\":0,\"pulishDate\":1625673600,\"slidePic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210708\\/09\\/20210708094307567894.png\",\"listPic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210708\\/09\\/20210708094307567894.png\",\"htmlUrl\":\"http:\\/\\/morefun.chinamcloud.com\\/act\\/custom-built-vote-screen\\/index.html?act_id=649b79cb-fd65-4d4f-8b6c-349131f8a5ff&group_id=59b8833e28c267350c8c0fa5d890c4a4\",\"wechatUrl\":\"\",\"startTime\":1625673600,\"endTime\":1628092800,\"contentSummary\":\"\",\"tag\":2},{\"id\":\"b0463ff2-3429-4a7c-9aad-bc1bddc3bf81\",\"title\":\"\\u7b2c\\u4e00\\u4e2a\\u6d3b\\u52a8\",\"shortTitle\":\"\",\"shareTitle\":\"\\u6ca1\\u6709\\u63cf\\u8ff0\\u624d\\u662f\\u771f\\u6b63\\u7684\\u63cf\\u8ff0\",\"summary\":\"\\u6ca1\\u6709\\u63cf\\u8ff0\\u624d\\u662f\\u771f\\u6b63\\u7684\\u63cf\\u8ff0\",\"shareImage\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/tmp\\/20210707\\/10\\/20210707105510041579.png\",\"shareOpen\":true,\"showNum\":0,\"model\":\"9\",\"modelName\":\"vote\",\"isComment\":0,\"pulishDate\":1625587200,\"slidePic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210707\\/10\\/20210707105550856930.jpg\",\"listPic\":\"https:\\/\\/morefan.oss-cn-beijing.aliyuncs.com\\/20210707\\/10\\/20210707105550856930.jpg\",\"htmlUrl\":\"http:\\/\\/morefun.chinamcloud.com\\/act\\/vote-screen\\/index.html?act_id=b0463ff2-3429-4a7c-9aad-bc1bddc3bf81&group_id=59b8833e28c267350c8c0fa5d890c4a4\",\"wechatUrl\":\"\",\"startTime\":1625587200,\"endTime\":1632499200,\"contentSummary\":\"\",\"tag\":2}],\"returnCode\":100,\"number\":10,\"currentPage\":1,\"totalPage\":0,\"total\":0,\"com_id\":1,\"serverTime\":1631780097,\"returnDesc\":\"\\u6210\\u529f\"}
去除转义后:
{"contentList":[{"id":"4228588d-06ba-4587-b234-28414db8f860","title":"\u522e\u522e\u522e","shortTitle":"","shareTitle":"","summary":"","shareImage":"","shareOpen":false,"showNum":0,"model":"9","modelName":"scratch","isComment":0,"pulishDate":1625673600,"slidePic":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/","listPic":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/","htmlUrl":"http:\/\/morefun.chinamcloud.com\/act\/scratch\/index.html?act_id=4228588d-06ba-4587-b234-28414db8f860&group_id=59b8833e28c267350c8c0fa5d890c4a4","wechatUrl":"","startTime":1625673600,"endTime":1637769600,"contentSummary":"","tag":2},{"id":"649b79cb-fd65-4d4f-8b6c-349131f8a5ff","title":"\u7b2c\u4e8c\u4e2a\u6d3b\u52a8","shortTitle":"","shareTitle":"aaaa","summary":"aa","shareImage":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/tmp\/20210708\/09\/20210708094246136048.png","shareOpen":true,"showNum":0,"model":"9","modelName":"vote","isComment":0,"pulishDate":1625673600,"slidePic":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210708\/09\/20210708094307567894.png","listPic":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210708\/09\/20210708094307567894.png","htmlUrl":"http:\/\/morefun.chinamcloud.com\/act\/custom-built-vote-screen\/index.html?act_id=649b79cb-fd65-4d4f-8b6c-349131f8a5ff&group_id=59b8833e28c267350c8c0fa5d890c4a4","wechatUrl":"","startTime":1625673600,"endTime":1628092800,"contentSummary":"","tag":2},{"id":"b0463ff2-3429-4a7c-9aad-bc1bddc3bf81","title":"\u7b2c\u4e00\u4e2a\u6d3b\u52a8","shortTitle":"","shareTitle":"\u6ca1\u6709\u63cf\u8ff0\u624d\u662f\u771f\u6b63\u7684\u63cf\u8ff0","summary":"\u6ca1\u6709\u63cf\u8ff0\u624d\u662f\u771f\u6b63\u7684\u63cf\u8ff0","shareImage":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/tmp\/20210707\/10\/20210707105510041579.png","shareOpen":true,"showNum":0,"model":"9","modelName":"vote","isComment":0,"pulishDate":1625587200,"slidePic":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210707\/10\/20210707105550856930.jpg","listPic":"https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210707\/10\/20210707105550856930.jpg","htmlUrl":"http:\/\/morefun.chinamcloud.com\/act\/vote-screen\/index.html?act_id=b0463ff2-3429-4a7c-9aad-bc1bddc3bf81&group_id=59b8833e28c267350c8c0fa5d890c4a4","wechatUrl":"","startTime":1625587200,"endTime":1632499200,"contentSummary":"","tag":2}],"returnCode":100,"number":10,"currentPage":1,"totalPage":0,"total":0,"com_id":1,"serverTime":1631780097,"returnDesc":"\u6210\u529f"}
3、去除转义后,点击 格式化校验,得到查看友好的 JSON 内容。如图3
{ "contentList": [{ "id": "4228588d-06ba-4587-b234-28414db8f860", "title": "\u522e\u522e\u522e", "shortTitle": "", "shareTitle": "", "summary": "", "shareImage": "", "shareOpen": false, "showNum": 0, "model": "9", "modelName": "scratch", "isComment": 0, "pulishDate": 1625673600, "slidePic": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/", "listPic": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/", "htmlUrl": "http:\/\/morefun.chinamcloud.com\/act\/scratch\/index.html?act_id=4228588d-06ba-4587-b234-28414db8f860&group_id=59b8833e28c267350c8c0fa5d890c4a4", "wechatUrl": "", "startTime": 1625673600, "endTime": 1637769600, "contentSummary": "", "tag": 2 }, { "id": "649b79cb-fd65-4d4f-8b6c-349131f8a5ff", "title": "\u7b2c\u4e8c\u4e2a\u6d3b\u52a8", "shortTitle": "", "shareTitle": "aaaa", "summary": "aa", "shareImage": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/tmp\/20210708\/09\/20210708094246136048.png", "shareOpen": true, "showNum": 0, "model": "9", "modelName": "vote", "isComment": 0, "pulishDate": 1625673600, "slidePic": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210708\/09\/20210708094307567894.png", "listPic": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210708\/09\/20210708094307567894.png", "htmlUrl": "http:\/\/morefun.chinamcloud.com\/act\/custom-built-vote-screen\/index.html?act_id=649b79cb-fd65-4d4f-8b6c-349131f8a5ff&group_id=59b8833e28c267350c8c0fa5d890c4a4", "wechatUrl": "", "startTime": 1625673600, "endTime": 1628092800, "contentSummary": "", "tag": 2 }, { "id": "b0463ff2-3429-4a7c-9aad-bc1bddc3bf81", "title": "\u7b2c\u4e00\u4e2a\u6d3b\u52a8", "shortTitle": "", "shareTitle": "\u6ca1\u6709\u63cf\u8ff0\u624d\u662f\u771f\u6b63\u7684\u63cf\u8ff0", "summary": "\u6ca1\u6709\u63cf\u8ff0\u624d\u662f\u771f\u6b63\u7684\u63cf\u8ff0", "shareImage": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/tmp\/20210707\/10\/20210707105510041579.png", "shareOpen": true, "showNum": 0, "model": "9", "modelName": "vote", "isComment": 0, "pulishDate": 1625587200, "slidePic": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210707\/10\/20210707105550856930.jpg", "listPic": "https:\/\/morefan.oss-cn-beijing.aliyuncs.com\/20210707\/10\/20210707105550856930.jpg", "htmlUrl": "http:\/\/morefun.chinamcloud.com\/act\/vote-screen\/index.html?act_id=b0463ff2-3429-4a7c-9aad-bc1bddc3bf81&group_id=59b8833e28c267350c8c0fa5d890c4a4", "wechatUrl": "", "startTime": 1625587200, "endTime": 1632499200, "contentSummary": "", "tag": 2 }], "returnCode": 100, "number": 10, "currentPage": 1, "totalPage": 0, "total": 0, "com_id": 1, "serverTime": 1631780097, "returnDesc": "\u6210\u529f" }
近期评论