37

How can I intercept the post data a page is sending in FF or Chrome via configuration, extension or code? (Code part makes this programming related. ;)

I currently use Wireshark/Ethereal for this, but it's a bit difficult to use.

Community
  • 1
  • 1
Carlsberg
  • 659
  • 2
  • 7
  • 8
  • related: [Chrome: Source of Post Data?](http://stackoverflow.com/questions/9163251/chrome-source-of-post-data) – David Cary Nov 16 '13 at 18:11

7 Answers7

29

You could just use the Chrome Developer Tools, if you only need to track requests. Activate them with Ctrl+Shift+I and select the Network tab.

This works also when Chrome talks HTTPS with another server (and unless you have the HTTPS private key you cannot use Wireshark to sniff that traffic).

(I copied this answer from this related query.)

Community
  • 1
  • 1
KajMagnus
  • 11,308
  • 15
  • 79
  • 127
  • As far as i know, only FireBug in Firefox has feature to track send POST data. I have tested with Safari and Chrome, they didn't have it. – GusDeCooL Mar 07 '13 at 13:50
  • 2
    @GusDeCooL It works fine in Chrome? I click CTRL + SHIFT + I then Chrome opens the Developer Tools window and then I click the "Network" tab. Now, if my browser makes a network request it appears on a row in this Network tab. I click that row, and if it's a POST request Chrome shows a *Form Data* section a bit further below on the *Headers* tab. – KajMagnus Mar 09 '13 at 12:34
24

With Firefox you can use the Network tab (Ctrl+Shift+E or Command+Option+E). The sub-tab "Params" shows the submitted form data.

Reference: https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_details#Params

Alternatively, in the console (Ctrl+Shift+K or Command+Option+K) right click on the big pane and check "Log Request and Response Bodies". Then when the form is submitted, a line with POST <url> will appear. Click on it; it will open a new window with the form data.

As of the time of originally writing this reply, both methods messed up newlines in textarea fields. The former deleted them, the latter converted them to blanks. I haven't checked with a newer version.

Pedro Gimeno
  • 2,837
  • 1
  • 25
  • 33
  • Brilliant, just what I was looking for, I could see the headers with various extensions but not the data posted, cheers. You can also see what it brought back in the individual request in the Response section etc. – Adamantus Jan 17 '19 at 14:05
  • Apologies. Apparently the shortcut has been changed to Ctrl+Shift+E - https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor. I've edited the question. Thanks for letting me know. – Pedro Gimeno Mar 01 '19 at 23:51
  • 2
    I can't see the "Log Request and Response Bodies" checkbox on Firefox 77.0. Is it still there? – OscarVanL Jun 04 '20 at 12:14
  • @PedroGimeno I closed the network tab and reopened it but i can't see the previous network details. Is there any way to see those once you've reopened the network tab? – y_159 Sep 28 '21 at 20:41
11

Do you have control of the browser POSTing the data?

If you do, then just use Firebug. It's got a lot of usefull features, including this

Radu094
  • 28,068
  • 16
  • 63
  • 80
  • Agree, and FireBug is the only reason why i still use FireBug. – GusDeCooL Mar 07 '13 at 13:49
  • 5
    Just a little added note: to keep the POST data from being cleared on page reload (like after you click a Submit button), go the Firebug "Net" tab and click the "Persist" button to keep POST history between pages. – Nathan Beach Dec 03 '13 at 20:14
3

For Firefox there is also TamperData, and even more powerful and cross-browser is Fiddler.

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • For nowadays versions, there's Temper Data for Quantum: https://addons.mozilla.org/en-US/firefox/addon/tamper-data-for-ff-quantum – Turtle10000 Aug 02 '22 at 14:52
0

Programatically, you can do this with dBug - it's a small code module you can integrate into any website. I use it with CodeIgniter and it works perfectly.

0

In network tab of Web Developer tools in firefox right click on the PUT, POST or any type of request, you will find "Use as Fetch in Console" option. Here we can seed the data we are passing.

fgohil
  • 43
  • 1
  • 7
0

Do the respective steps sequentially.

Firefox Inspect Network POST Request

parmer_110
  • 325
  • 2
  • 11