How to view the whole raw http request? How to view the whole raw http request? google-chrome google-chrome

How to view the whole raw http request?


In the Chrome DevTools, under the Network section, right-click on the line you are interested in and select the appropriate type of copy from the context menu:

enter image description here

An example clipboard content looks like this:

Copy as cURL

curl 'https://stackoverflow.com/posts/25291052/editor-heartbeat/answer' \  -H 'authority: stackoverflow.com' \  -H 'pragma: no-cache' \  -H 'cache-control: no-cache' \  -H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \  -H 'accept: application/json, text/javascript, */*; q=0.01' \  -H 'x-requested-with: XMLHttpRequest' \  -H 'sec-ch-ua-mobile: ?0' \  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36' \  -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \  -H 'origin: https://stackoverflow.com' \  -H 'sec-fetch-site: same-origin' \  -H 'sec-fetch-mode: cors' \  -H 'sec-fetch-dest: empty' \  -H 'referer: https://stackoverflow.com/questions/25291052/how-to-view-the-whole-raw-http-request' \  -H 'accept-language: en,pl;q=0.9,es;q=0.8' \  -H 'cookie: prov=8a6c8983-02cd-669c-367d-61ff657f111e; _ga=GA1.2.1494864357.1594965293; __qca=P0-618917173-1594965293194; __gads=ID=86eda01ab828f223:T=1594965534:R:S=ALNI_MZ6mV2_oJewkg2Z7wubZCCK_dFI0Q; gadsTest=test; sgt=id=9653ade3-9325-4178-a074-d2ff62012690; _gid=GA1.2.480664929.1621240994; acct=t=PYE1PDFUezJZN%2b7eJHz4uQtgdkSgmrsw&s=NfLIf8YH%2f3FPmxGoaPDa2w5sB%2bzihVsv' \  --data-raw 'fkey=39c9ef4d76e1af44087482fe5f9802ac518ce9725a5323015874a7e69a493dea&clientCount=4' \  --compressed

Copy as fetch

fetch("https://stackoverflow.com/posts/25291052/editor-heartbeat/answer", {  "headers": {    "accept": "application/json, text/javascript, */*; q=0.01",    "accept-language": "en,pl;q=0.9,es;q=0.8",    "cache-control": "no-cache",    "content-type": "application/x-www-form-urlencoded; charset=UTF-8",    "pragma": "no-cache",    "sec-ch-ua": "\"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\"",    "sec-ch-ua-mobile": "?0",    "sec-fetch-dest": "empty",    "sec-fetch-mode": "cors",    "sec-fetch-site": "same-origin",    "x-requested-with": "XMLHttpRequest"  },  "referrer": "https://stackoverflow.com/questions/25291052/how-to-view-the-whole-raw-http-request",  "referrerPolicy": "strict-origin-when-cross-origin",  "body": "fkey=39c9ef4d76e1af44087482fe5f9802ac518ce9725a5323015874a7e69a493dea&clientCount=4",  "method": "POST",  "mode": "cors",  "credentials": "include"});

We also have the option to retrieve a specific response or all requests from the list at once using one of the "Copy all as ..." options.

Try it yourself and choose the most suitable option for you.

This site inspired my answer.


If there is no way to see these information native in chrome you could allways fall back to use a web debugging proxy (f.e. fiddler) or a web penetration testing proxy (f.e. owasp ZAP).

Then no information which are send or receive can be hidden. You can see everything in raw format. In case of ZAP you have also the ability to record all communication in raw format as text files and you can intercept requests and responses for debugging purpose.