Created
January 16, 2022 21:43
-
-
Save hiteshchopra11/e5ff2f82fa525de58f0b86ac5a4ae563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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