4

I'm trying to debug an ajax request that POSTs data by inspecting the output of the request. The 'network' tab fails me as it states, "Failed to load response data" - I assume since it's a stacktrace and not JSON as expected.

Not a problem though, I figure I'll just take that XHR request and open it up in a new tab where I can browse over the dumped data. I right click and choose 'Open in new tab'. The new tab opens up but I get an error instead of my dump because the request did not include the POST data.

My workaround is to use the 'Copy as cURL' option and then paste that into my terminal. I don't like the extra step and depending what the output is it's hard to decipher in an ANSI terminal.

Is Google trying to "protect" me from resubmittal? Does the 'Replay XHR' context menu option do anything? Seems to do nothing for me. This is a pet peeve I wondered if others had experienced. Workarounds? Live with it?

3
  • Did you ever figure this out? I"m having the same issue. "Replay XHR" doesn't do anything at all on a simple GET request.
    – Chris G.
    Commented Jan 17, 2018 at 20:02
  • My issue turned out to be service workers. I turned our apps service worker off and it finally allowed me to replay requests
    – Chris G.
    Commented Jan 17, 2018 at 21:34
  • Ahh. Related but different issue perhaps? Service workers are really a whole other beast I feel like. I'm sure tools have improved for debugging that layer of late. Not something I'm too up to speed on though.
    – ficuscr
    Commented Jan 17, 2018 at 21:52

1 Answer 1

3

My current workaround is to use the new Firefox Developer Edition.

The web console / developer tools work better in my opinion. Specifically I can open an Xhr request from the network tab in a 'new tab' and the POST data carries over to that new tab allowing me to simply refresh the page and replay the POST. Back to coding productively!

2
  • Awesome find, works great for me as well.
    – Paul I
    Commented Dec 14, 2018 at 15:40
  • How can I do that? My Firefox Developer edition converts POST request to GET.
    – user51872
    Commented Apr 8, 2021 at 7:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .