Skip to content

Instantly share code, notes, and snippets.

@oaugusto256
Created November 7, 2019 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oaugusto256/0f0986cde73c76d74f0a455c006dff74 to your computer and use it in GitHub Desktop.
Save oaugusto256/0f0986cde73c76d74f0a455c006dff74 to your computer and use it in GitHub Desktop.
See all request being made at your React application
// To see all the requests in the chrome Dev tools in the network tab.
XMLHttpRequest = GLOBAL.originalXMLHttpRequest ?
GLOBAL.originalXMLHttpRequest :
GLOBAL.XMLHttpRequest;
// fetch logger
global._fetch = fetch;
global.fetch = function (uri, options, ...args) {
return global._fetch(uri, options, ...args).then((response) => {
console.log('Fetch', { request: { uri, options, ...args }, response });
return response;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment