Hey everyone! I'm working on a web app that requires tracking and storing all network requests, including their payloads, so we can keep a record even if a request fails due to issues like internet disconnection. I'm aware that many suggest checking the network tab, but that information gets lost when the page refreshes. We're concerned with requests like POST and PUT, particularly those that might not reach the server. I've considered using LocalStorage and wrapping fetch or axios for saving these requests, but that raises security concerns since it will be accessible in the browser. Is there a better way to handle this in React, or could something like HTTP Toolkit help us out?
1 Answer
React's just the UI part, right? The tracking and storage logic should ideally be in your API client, not React itself. Instead of storing all requests, consider tracking only the necessary data needed for sync operations.

I get what you're saying, but I really need to log the requests that didn’t go through so we can retry them later.