Attributes

    Ktor offers an class that acts as a small typed instance container/dependency injector.

    You can set as many attributes as required per call on an interceptor and retrieve them later in another interceptor.

    In the case of the client, the HttpRequest also contains an attributes property. So from a instance, you can access the attributes with call.request.attributes.

    You can later set the attributes with:

    And retrieve them in another interceptor by calling:

    API reference