theapache64
03/04/2022, 10:25 AMtheapache64
03/04/2022, 10:26 AM@JsonClass(generateAdapter = true)
data class MockResponse(
@Json(name = "description")
val description: String, // Internal Server Error
@Json(name = "statusCode")
val statusCode: Int // 500
)
interface Api {
@GET("200")
suspend fun get200(): Response<MockResponse>
}
fun main() = runBlocking {
val retrofit = Retrofit.Builder()
.baseUrl("<https://mock.codes/>")
.addConverterFactory(MoshiConverterFactory.create())
.build()
val api = retrofit.create(Api::class.java)
println(api.get200().body())
}
Sam
03/04/2022, 10:42 AMtheapache64
03/04/2022, 10:49 AMclient.dispatcher().executorService().shutdown()
client.connectionPool().evictAll()
Fixed the issue. Thanks @SamSam
03/04/2022, 10:50 AM