onResponse

fun onResponse(block: suspend OnResponseContext.(response: HttpResponse) -> Unit)

Specifies the block handler for every HTTP response.

This block is invoked for every incoming response. There you can inspect the response in a way you want: save cookies, add logging, etc.

See also

Parameters

block

An action that needs to be executed when a client receives an HTTP response.