Home > Enterprise >  How to view implementation of retrofit's suspend fun
How to view implementation of retrofit's suspend fun

Time:07-26

I am trying to understand how retrofit implements the following suspend function:

@GET("api/me")
suspend fun getUser(): User

Is there anyway that I can access the locally generated implementation code?

Thanks!

CodePudding user response:

According to docs,

Behind the scenes this behaves as if defined as fun user(...): Call and then invoked with Call.enqueue. You can also return Response for access to the response metadata.

Everything else lies inside the sources like this class. Btw, I'm just curious, why do you need to understand the exact implementation from the Retrofit side?

  • Related