Skip to content

okhttp / okhttp3 / Request / Builder / tag

tag

open fun tag(tag:Any?): Builder

Attaches tag to the request using Object.class as a key.

open fun <T> tag(type:Class<in T>, tag: T?): Builder

Attaches tag to the request using type as a key. Tags can be read from a request using Request.tag. Use null to remove any existing tag assigned for type.

Use this API to attach timing, debugging, or other application data to a request so that you may read it in interceptors, event listeners, or callbacks.