How can I debug a HTTP POST in Chrome?

Google ChromeDebuggingPost

Google Chrome Problem Overview


I would like to view HTTP POST data that was sent in Chrome.

The data is in memory now, and I have the ability to resubmit the form.

I know that if I resubmit the server will throw an error. Is there anyway I can view the data that is in Chrome's memory?

Google Chrome Solutions


Solution 1 - Google Chrome

  1. Go to Chrome Developer Tools (Chrome Menu -> More Tools -> Developer Tools)
  2. Choose "Network" tab
  3. Refresh the page you're on
  4. You'll get list of http queries that happened, while the network console was on. Select one of them in the left
  5. Choose "Headers" tab

Voila!

enter image description here

Solution 2 - Google Chrome

You can filter for HTTP POST requests with the Chrome DevTools. Just do the following:

  1. Open Chrome DevTools (Cmd+Opt+I on Mac, Ctrl+Shift+I or F12 on Windows) and click on the "Network" tab
  2. Click on the "Filter" icon
  3. Enter your filter method: method:POST
  4. Select the request you want to debug
  5. View the details of the request you want to debug

Screenshot

Chrome DevTools

Tested with Chrome Version 53.

Solution 3 - Google Chrome

You can use Canary version of Chrome to see request payload of POST requests.

Request payload

Solution 4 - Google Chrome

Another option that may be useful is a dedicated HTTP debugging tool. There's a few available, I'd suggest HTTP Toolkit: an open-source project I've been working on (yeah, I might be biased) to solve this same problem for myself.

The main difference is usability & power. The Chrome dev tools are good for simple things, and I'd recommend starting there, but if you're struggling to understand the information there, and you need either more explanation or more power then proper focused tools can be useful!

For this case, it'll show you the full POST body you're looking for, with a friendly editor and highlighting (all powered by VS Code) so you can dig around. It'll give you the request & response headers of course, but with extra info like docs from MDN (the Mozilla Developer Network) for every standard header and status code you can see.

A picture is worth a thousand StackOverflow answers:

A screenshot of HTTP Toolkit showing a POST request and its body

Solution 5 - Google Chrome

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.

Solution: Before submitting the post form, you need to cut off your network, which makes the request cannot send successfully so that the tab will not be closed. And then you can capture the request message in the Chrome Devtool(Refreshing the new tab if necessary)

Solution 6 - Google Chrome

On Chrome 96 DevTools Network Tab;

After clicking the request, there is a "Payload" tab that shows the Form Data:

enter image description here

You can view the data as url encoded / decoded:

![enter image description here

You can view the data as source / parsed:

enter image description here

Even if the method is GET you can see the Payload as Query String Parameters:

enter image description here

Solution 7 - Google Chrome

The Network tab is all you need...

enter image description here

Solution 8 - Google Chrome

The other people made very nice answers, but I would like to complete their work with an extra development tool. It is called Live HTTP Headers and you can install it into your Firefox, and in Chrome we have the same plug in like this.

Working with it is queit easy.

  1. Using your Firefox, navigate to the website which you want to get your post request to it.

  2. In your Firefox menu Tools->Live Http Headers

  3. A new window pop ups for you, and all the http method details would be saved in this window for you. You don't need to do anything in this step.

  4. In the website, do an activity(log in, submit a form, etc.)

  5. Look at your plug in window. It is all recorded.

Just remember you need to check the Capture.

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionmakerofthings7View Question on Stackoverflow
Solution 1 - Google ChromemrówaView Answer on Stackoverflow
Solution 2 - Google ChromeBenny NeugebauerView Answer on Stackoverflow
Solution 3 - Google ChromemihijsView Answer on Stackoverflow
Solution 4 - Google ChromeTim PerryView Answer on Stackoverflow
Solution 5 - Google Chrome周左左View Answer on Stackoverflow
Solution 6 - Google ChromeAdem TepeView Answer on Stackoverflow
Solution 7 - Google Chromedev mambaView Answer on Stackoverflow
Solution 8 - Google ChromeSal-laSView Answer on Stackoverflow