我以为我知道如何做到这一点,但显然不是。我有来自 Flickr 的 API,它的开头是这样的:
jsonFlickrApi({
"photos":{
"page":1,
"pages":10,
"perpage":100,
"total":1000,
"photo":[
{
"id":"12567883725",
"owner":"74574845@N05",
"secret":"a7431762dd",
"server":"7458",
"farm":8,
"title":"",
"ispublic":1,
"isfriend":0,
"isfamily":0,
"url_l":"http:\/\/farm8.staticflickr.com\/7458\/12567883725_a7431762dd_b.jpg",
"height_l":"683",
"width_l":"1024"
}
现在我需要获取的信息来自照片数组,所以我一直在尝试做的是:
interface ArtService {
@GET("/services/rest/?method=flickr.photos.getRecent&extras=url_l&owner_name&format=json")
PhotosResponse getPhotos();
public class PhotosResponse {
Photos photos;
}
public class Photos {
List<Arraz> photo;
}
public class Arraz {
int id;
String title;
String owner;
String url_l;
}
}
很清楚我似乎没有抓住重点,但是我不确定如何获取信息..