have json file like this :
"posts": [
{
"title": "hello"
},
"attachments": [
"url":"some url"
]
]
this is my interface:
public interface RequestInterface {
@GET("http://memaraneha.ir/category/%d9%85%d9%82%d8%a7%d9%84%d8%a7%d8%aa/?json=1")
Call<JSONResponse> getJSON();
}
this is my JSONResponse:
public class JSONResponse {
private Deatails[] posts;
public Deatails[] getPosts() {
return posts;
}
}
and this is my deatails class :
public class Deatails {
private String title;
public String getTitle() {
return title;
}
}
as you see get title from posts and work fine but dont know how get url from attachments inside posts!?