Modify Response before Caching using dio interceptor #1852
Unanswered
jakobkoerber
asked this question in
Q&A
Replies: 1 comment
-
Not really sure what dio can do in this case. You can write your interceptor on your own, and block requests until you finished the conversion from your caches. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 😄
Is it possible to modify the response body before caching it using dio interceptors and HiveDB? The APIs I need to use only return XML bodies and since Dart has a hard time using those I would like to convert the body to JSON once and cache the JSON body instead of the XML body. Converting it once doesn't seem like the biggest performance hit but converting it every time the data is fetched out of cache is. Is it therefore possible to pass a converter function to dio?
Maybe there is a better solution on doing this. Let me know!
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions