Cannot Parse JSON Response Object

前端 未结 1 747
一向
一向 2021-01-27 23:18

I am trying to parse a JSON response from FlickR, however I am having difficulty. I have ran some tests, and I am receiving a response code of 200 and am able to view the actual

相关标签:
1条回答
  • 2021-01-28 00:06

    Your POJO class is not fit to server response so your body is Null. Your model should be like below:

    public class Model {
    
        // I guess it should be List too -> List<Photos>
        // your response is not complete to see 
        Photos photos;
    
    
        public class Photos{
            int page;
            int pages;
            int perpage;
            int total;
            List<Photo> photo;
    
    
            //this photo class is inner class of Photos
            public class Photo{
                String id;
                String owner;
                String secret;
                //rest of things
    
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题