a simple html page,
<body>
<form method="POST" action="abc">
<input ... />
</form>
</body>
submit the form with javascript
document.getElementsByTagName('form')[0].submit()
The request was indeed submitted (the server return a file as download), but I could not find any activity in network tab.
any idea? thanks in advance.
Update: Firefox is working well on capturing this.
It has a tricky situation: If you submit a post form, then Chrome will open a new tab to send the request. It's right until now, but if it triggers an event to download file (s), this tab will close immediately so that you cannot capture this request in the Dev Tool.
View Submitted Form Data in Chrome If you’ve ever needed to inspect the form data after submitting a form on a web page, you should take a look a closer look at the Network panel in Chrome developer tools. You can click on an HTTP request, which for a POST request is typically the first one in the list after a form submission.
Most browser Developer Tools have a "Network" tab that allows you to capture network activity between the browser and the server. Microsoft Edge (Chromium) Open the DevTools. Select F12; Select Ctrl+Shift+I (Windows/Linux) or Command+Option+I (macOS) Select Settings and more and then More Tools > Developer Tools; Select the Network Tab
Open Chrome DevTools (Cmd+Opt+I on Mac, Ctrl+Shift+I or F12 on Windows) and click on the "Network" tab. Click on the "Filter" icon. Enter your filter method: method:POST. Select the request you want to debug.
From https://stackoverflow.com/a/55197547/3774338
If it triggers an event to download a file, Chrome will create a new tab and this tab will be closed immediately so that you cannot capture this request in Dev Tools.
Solution: check 'Offline' checkbox at the network tab, which will fail to send the request, so the tab will not be closed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With