I'm fetching data from API. I get the json response normally when I use the browser. But it's empty when I use retrofit. This this the api interface:
interface FootballApi {
@GET(".")
suspend fun getAllMatches(
@Query("action") action:String = "get_events",
@Query("match_live") match_live:String = "1",
@Query("APIkey") apiKey:String = API_KEY
):Response<ApiResponse>
}
This is the path which I use it to get the json response from browser:
https://apiv3.apifootball.com/?action=get_events&match_live=1&APIkey=xxxxxx
When I log the response.body() this is what I get:
D/ViewModel: []
Any help?
Edit: I should note that it returns true when I check if (response.isSuccessful)