lovespring
lovespring

Reputation: 19559

debug XHR in chrome browser

How to see the post content in chrome?

Upvotes: 18

Views: 52274

Answers (8)

Varun kashyap
Varun kashyap

Reputation: 1

Add on: If you cannot see Fecth/xhr,JS,CSS etc option in the Network tab.

Then don't try checking into each setting , instead "RESTORE DEFAULTS AND RELOAD: ( bottom of the setting). The options will appear, later you can edit settings.

Hope it helps.

Upvotes: 0

Gino
Gino

Reputation: 1113

2020 Update

In the current version of Chrome (Google Chrome 81.0.4044.138) you can simply

  • Open the developer tools
  • Navigate to the console
  • Click on the console settings (represented by the sprocket widget near the top right corner)
  • Toggle on 'Log XMLHttpRequests'

Upvotes: 5

Yash Ranadive
Yash Ranadive

Reputation: 41

2015 Update

The latest chrome forces you to select the request (represented by a small blue dot) in the timeline. Use the slider hooks to zoom in to the time you sent the request after the page loaded in your browser. You will see the request(s) in the pane below the timeline(which was hidden in my case and I had to drag the dev console much deeper in to the page real estate). I'm guessing google added this so you could track events across time better.

Upvotes: 0

Jonathan Lin
Jonathan Lin

Reputation: 20694

2015 Update

Chrome version 43 now, go to Settings > General > Console and check the "Log XMLHttpRequests" option.

Update: I wanted to see the XHR Object, but it seems I still can't do that despite the logging.

Upvotes: 8

bdonlan
bdonlan

Reputation: 231103

One option would be to use a normal packet sniffer like wireshark. It seems that chrome now supports directly sniffing XHR, see below.

Upvotes: 2

Philluminati
Philluminati

Reputation: 2789

In the Javascript console pane right click and tick the "Log XMLHttpRequests" option. Then in the developer tools section choose the network tab.

When you fire the Ajax request a new item will (sometimes delayed) appear in the network tab. Click on it to inspect it and then choose "Headers".

That will show you the post data you just sent.

Upvotes: 5

russellfeeed
russellfeeed

Reputation: 627

On Windows, Chrome 12, I had to right-click somewhere in the console window and tick XMLHttpRequest logging to enable this.

Upvotes: 9

d34dh0r53
d34dh0r53

Reputation: 683

Start up the Developer tools (Shift+Ctrl+J on Linux) and click Enable Resource Tracking. The page will refresh. Click on the Resources button, XHRs are colored yellow. To see the post content simply click on the resource. The POST content is in the Request Headers. You can also filter out just the XHRs with the XHR button in the bar below the tabs.

Hope this helps,
d34dh0r53

Upvotes: 33

Related Questions