I have used gson before to automatically convert to pojo\'s.
but now im trying to use retrofit to convert an api result to objects.
As long as the json has n
To Handle json response like this:
[
{"name":"foo"},
{"name":"bar"}
]
Use Call< List < AnItem>>
In Retrofit2, HttpUrl.resolve() is used to resolve baseUrl and annotated path.
Due to how this works,
This works:
.baseUrl("http://someurl.com")
@GET("/api/itemlist") --> resolved to http://someurl.com/api/itemlist
or this works
.baseUrl("http://someurl.com/api/")
@GET("itemlist") ---> resolved to http://someurl.com/api/itemlist
However, this would not work
.baseUrl("http://someurl.com/api")
@GET("/itemlist") ---> resolved to http://someurl.com/itemlist