Why Coroutine concurrency post body error
I have two api using Coroutine and retorfit
@POST("/api1")
fun api1(@Body requestBody: Request1)
@POST("/api2")
fun api2(@Body requestBody: Request2)
how I call
fun callApi1() {
GlobalScope.launch {
Apiservice.api1()
...
}
}
fun callApi2() {
GlobalScope.launch {
Apiservice.api2()
...
}
}
they both work and get correct response I want
but when I call them at the same time every 5 seconds
fun getApi() {
GlobalScope.launch {...