Recently I'm not able to copy a parsed request payload from Chrome DevTools. Button is disabled. I'm able to copy normal POST and GET request but not a parsed JSON payload.
This is huge pain in the ... Anyone know the solution for it?
Recently I'm not able to copy a parsed request payload from Chrome DevTools. Button is disabled. I'm able to copy normal POST and GET request but not a parsed JSON payload.
This is huge pain in the ... Anyone know the solution for it?
Came to your question having the same problem.
My solution: Select the text with your mouse pointer and make sure you are not selecting more than the whole content, then try again.
I was selecting more than the contents by triple clicking it and it wouldn't let me copy, probably a bug in chrome.
As of Oct 2023, you can copy the Payload directly as an object. Be sure to have the view below showing "view source" instead of "view parsed". In my experience, it doesn't make a difference in the content copied only in the pain of performing the copy.
Relatedly, you can also copy the entire request, including headers, payload (body), and other HTTP request metadata. Unfortunately or fortunately, the copying is program specific, so if it is a program you want to use, then it works amazingly. If you just want the JSON, the closest I've found is to "Copy as fetch" and remove the "fetch(...)" call from around the JSON object.
Sample copy from fetch below:
fetch("https://us-west-1-chat-server.frontapp.com/initialize", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.7",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-ch-ua": "\"Brave\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"sec-gpc": "1"
},
"referrer": "https://better.com/",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "{...}",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
Similarly to what @NickBrady said:
Response
tab.copy(JSON.parse('{paste the response}'))
[hit enter] NOTE: You have to wrap the response in quotes for JSON.parse() to work.temp1
, and then typed copy(JSON.parse(temp1))
. –
Lailalain First you need to click on response, then all will be selected. now again on the selected response, you can select from where ever you need with the mouse left, and the just right-click on it. You will get it. I do like that only when I need form data.
© 2022 - 2024 — McMap. All rights reserved.