Reputation: 1001
I would like to know if it is possible to have a global HTTP interceptor for http: ^0.13.4 package to attach token in header for all requests in Flutter or catch error 401 and relogin in one method? thanks a lot!
Upvotes: 0
Views: 971
Reputation: 26
I assume you need a better HTTP Request for handling errors. Perhaps, you can check Dio Package.
So far as I know, Dio could handle many details about HTTP Request requirements, including attaching tokens to the header.
Upvotes: 1