Skip to content

Latest commit

 

History

History
28 lines (26 loc) · 716 Bytes

README.md

File metadata and controls

28 lines (26 loc) · 716 Bytes

Simple Retrofit-like HTTP library

Based on Java Dynamic Proxy
Written in educational purposes only
Using Denom common library for networking

Usage

Init HttpClient

 val httpClient = HttpClient.Builder()
    .baseUrl("https://cataas.com")
    .build()

Create service interface

interface CatService {
    @Get("cat")
    fun getCatById(@Param("id") id: Long): HttpClientResponse

    @Get("api/cats")
    fun getCuteCats(@Param("tags") tags: String, @Param("limit") limit: Int): HttpClientResponse
}

Prepare service interface to use

val catService: CatService = httpClient.create()