title: How to pass data between various parts of the pipeline in Ktor (Kotlin)
body: <p>Am building an API and using <code>intercept(ApplicationCallPipeline.Call){}</code> to run some logic before each route execution. I need to pass  data from the intercept() method to the called route and
  am setting data by using <code>call.attributes.put()</code> in the intercept() like this:</p>
  
  <p><code>val userKey= AttributeKey&lt;User&gt;("userK")
   call.attributes.put(userKey, userData)</code></p>
  
  <p>And retrieve <strong>userData</strong> with <code>call.attributes[userKey]</code> .
  What happens is that <code>call.attributes[userKey]</code> only works in the intercept() method where I have set the attribute. It doesn't work in the route where I need it.
  It throws me 
  <code>java.lang.IllegalStateException: No instance for key AttributeKey: userK</code></p>
  
  <p>I wonder if am doing things in the right way</p>