Jaguar-dart/client

Retrofit interceptor example

jaumard opened this issue · 2 comments

Miss some example on how to use them:

  • multiple interceptors on a route (I just saw intereceptBefore/After but it's not a list)
  • global interceptors to multiple route (Just saw how put them on a route)
  • having the posibility to have interceptors after deserialization (for now only possible to have the response as String)

Here is a wiki for using interceptor with Resty: https://github.com/Jaguar-dart/client/wiki/Interceptors

Thanks for the wiki ! :)
Here it's few improvements I think would be nice to have to be more modular:

Having a class Interceptor with before and after the we'll extend in order to create an Interceptor. Then pass it to the route like route.add(interceptor), like this a route can have a list of interceptors and each one doing his own work (one for logs only in debug, one for default headers, one for auth management...)