如何在Java中解析JSON - How to parse JSON in Java

問題:

I have the following JSON text. 我有如下JSON文本。 How can I parse it to get the values of pageName , pagePic , post_id , etc.? 如何解析它以得到pageNamepagePicpost_id等的值? post

{
   "pageInfo": {
         "pageName": "abc",
         "pagePic": "http://example.com/content.jpg"
    },
    "posts": [
         {
              "post_id": "123456789012_123456789012",
              "actor_id": "1234567890",
              "picOfPersonWhoPosted": "http://example.com/photo.jpg",
              "nameOfPersonWhoPosted": "Jane Doe",
              "message": "Sounds cool. Can't wait to see it!",
              "likesCount": "2",
              "comments": [],
              "timeOfPost": "1234567890"
         }
    ]
}

解決方案:

參考一: https://stackoom.com/question/As3u/如何在Java中解析JSON
參考二: https://oldbug.net/q/As3u/How-to-parse-JSON-in-Java
相關文章
相關標籤/搜索