Replies: 1 comment
-
Never mind. Updating the responseHandler to return a json instead of a raising Error seems to be good enough. Updated function handler, responseHandler: (response: any) => {
if (!response.ok) {
return { error: response.statusText, status: response.status };
}
return response.blob();
} |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Even though RTKQuery is primarily is meant for caching responses, I'm looking for a way handle blob / file responses (with no-cache) as a part of the work flow.
With a custom BaseQuery I'm handling authentication and token refresh. I'd like to keep using RTKQ and not duplicate the authentication logic just for file downloads.
Is there an escape hatch to disable automatic parsing and tags? I can use that to just redirect to a new page when the content-disposition header contains
attachment
?Currently my API looks like this and the automatic re-authenticatio does not seem to be triggered
Beta Was this translation helpful? Give feedback.
All reactions