Edit and replay XHR chrome/firefox etc?

madsobel picture madsobel · Feb 27, 2015 · Viewed 119.7k times · Source

I've been looking for a way to alter a XHR request made in my browser and then replay it again. Say I have a complete POST request done in my browser, and the only thing I want to change is a small value and then play it again. This would be a lot easier and faster to do directly in the browser.

I've google'd a bit around, and haven't found a way to do this in Chrome or Firefox. Is there some way to do it in either one of those browsers, or maybe another one?

Answer

Michael P. Bazos picture Michael P. Bazos · Feb 27, 2015

Chrome :

  • In the Network panel of devtools, right-click and select Copy as cURL
  • Paste / Edit the request, and then send it from a terminal, assuming you have the curl command

See capture :

enter image description here

Alternatively, and in case you need to send the request in the context of a webpage, select "Copy as fetch" and edit-send the content from the javascript console panel.


Firefox :

Firefox allows to edit and resend XHR right from the Network panel. Capture below is from Firefox 36:

enter image description here