Edit and replay XHR chrome/firefox etc?

前端 未结 9 2076
有刺的猬
有刺的猬 2021-01-30 00:38

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

相关标签:
9条回答
  • 2021-01-30 01:08

    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

    0 讨论(0)
  • 2021-01-30 01:08

    There are a few ways to do this, as mentioned above, but in my experience the best way to manipulate an XHR request and resend is to use chrome dev tools to copy the request as cURL request (right click on the request in the network tab) and to simply import into the Postman app (giant import button in the top left).

    0 讨论(0)
  • 2021-01-30 01:08

    Microsoft Chromium-based Edge supports "Edit and Replay" requests in the Network Tab as an experimental feature:

    More details about the feature and how to enable it can be found here

    0 讨论(0)
提交回复
热议问题