We have a basic RTK API Slice that based on fetchBaseQuery just like recommended on RTK documentation.
Also, there is a backend service that returns data as a text in a response, but declared as a Content-Type: application/json
on Response Header. I know this is not a consistent but unfortunately, we don't have a privilege to change this now.
We tried to parse it in a proper way but we can't have any clue about the data, we didn't see in RTK, even cannot reached inside of transformResponse
. We have saw the expected response when we inspected the XHR/Fetch activity on the network tab and that is the only clue we received the data successfully.
I think RTK doesn't process this data because it is declared as a json on response header but provided as a text, string inside of the body. It is a little bit awkward because we don't see any error anywhere.
Do you have any idea how we can reach the response inside of the RTK?