Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
interface ImageService {
@GET("/photos?page=1")
suspend fun getImages(): ImageResponse
}
object RetrofitBuilder {
private const val BASE_URL = "https://api.unsplash.com/"
private fun getRetrofit(): Retrofit {
return Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()
}
val apiService: ApiService = getRetrofit().create(ApiService::class.java)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment