ChatGPT解决这个技术问题 Extra ChatGPT

How can I view HTTP headers in Google Chrome?

Till 9.x, the headers were under the resources in the Developer Tools, but now I can't find it anywhere.


J
Jeff Atwood

I'm not sure about your exact version, but Chrome has a tab "Network" with several items and when I click on them I can see the headers on the right in a tab.

Press F12 on windows or ⌥⌘I on a mac to bring up the Chrome developer tools.

https://i.stack.imgur.com/1dolH.png


Got it, thanks! The page had to be reloaded to view the items.
That's very nice! I used the chrome://view-http-cache/[url] hack but your solution is a lot nicer!
Also try chrome://net-internals/.
Just to clarify the answer above a bit - when you click on the network tab you see an overview at first on the right side in a table format with a timeline graph. If you click on an individual file from the list at the left you will then see the tabs shown in the picture above (including the Headers tab). This is what @Tower meant by "click on them"
More to note: if you don't see any resources - look at tabs area (All | XHR JS and etc) and select All
7
7ochem

For me, as of Google Chrome Version 46.0.2490.71 m, the Headers info area is a little hidden. To access:

While the browser is open, press F12 to access Web Developer tools When opened, click the "Network" option Initially, it is possible the page data is not present/up to date. Refresh the page if necessary Observe the page information appears in the listing. (Also, make sure "All" is selected next to the "Hide data URLs" checkbox)

see screenshot


Following this procedure, also: 5. Click on the name of the desired resource in the list on the left. 6. The preview view will appear in a panel to the right of this list. Above, there are some tabs. Click on the "Headers" tab. 7. Now, there you go!
M
Mustkeem K

My favorite way in Chrome is clicking on a bookmarklet:

javascript:(function(){function read(url){var r=new XMLHttpRequest();r.open('HEAD',url,false);r.send(null);return r.getAllResponseHeaders();}alert(read(window.location))})();

Put this code in your developer console pad.

Source: http://www.danielmiessler.com/blog/a-bookmarklet-that-displays-http-headers


That doesn't get the current headers, but instead the headers for a 2nd request.
M
Michiel Roos

I loved the FireFox Header Spy extension so much that i built a HTTP Spy extension for Chrome. I used to use the developer tools too for debugging headers, but now my life is so much better.

Here is a Chrome extension that allows you to view request-, response headers and cookies without any extra clicks right after the page is loaded.

It also handles redirects. It comes with an unobtrusive micro-mode that only shows a hand picked selection of response headers and a normal mode that shows all the information.

https://chrome.google.com/webstore/detail/http-spy/agnoocojkneiphkobpcfoaenhpjnmifb

Enjoy!


C
Community

You can find the headers option in the Network tab in Developer's console in Chrome:

In Chrome press F12 to open Developer's console. Select the Network tab. This tab gives you the information about the requests fired from the browser. Select a request by clicking on the request name. There you can find the Header information for that request along with some other information like Preview, Response and Timing.

Also, in my version of Chrome (50.0.2661.102), it gives an extension named LIVE HTTP Headers which gives information about the request headers for all the HTTP requests.

update: added image

https://i.stack.imgur.com/zC5Ua.png


just in case someone will need it: if 'show overview' is checked, it is listed bellow the overview and might not be visible (happened to me). You can click the icon 'hide overview' or extend developer toolbox
@Chris22 please take a look at the image in post
@AngelM. thanks, ok so according to the image, the 'show overview' is not a checkbox, it's an icon.
L
Leandro Bardelli

I know there is an accepted answer but I recommend

Talend API Tester - REST Client Extension for Chrome.

example:

https://i.stack.imgur.com/vhHid.png

Response shows headers in the same way as petition


Z
Zgpeace

To view the request or response HTTP headers in Google Chrome, take the following steps :

In Chrome, visit a URL(such as https://www.google.com), right click, select Inspect to open the developer tools. Select Network tab. Reload the page, select any HTTP request on the left panel, and the HTTP headers will be displayed on the right panel.

https://i.stack.imgur.com/h9iou.png


M
Muhammad Ameen

In Chrome, Right-click on the screen and select inspect

https://i.stack.imgur.com/M3wsQ.jpg

select the Network Tab

https://i.stack.imgur.com/9DiFZ.jpg

and then press Ctrl + R You can see Name, Header, Response, and other tabs

https://i.stack.imgur.com/PmhDr.jpg


D
Deepak Agrawal

For Version 78.0.3904.87, OS = Windows 7, 64 bit PC

Steps:

Press F12 Select Network Tab Select XHR Under Name --> you can see all the XHR requests made. To view Request Headers of a particular XHR request, click on that request. All details about that XHR request will appear on right hand side.