Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcus-at-localhost/000e9f7a476fd6ad5087301372a9a12e to your computer and use it in GitHub Desktop.
Save marcus-at-localhost/000e9f7a476fd6ad5087301372a9a12e to your computer and use it in GitHub Desktop.
Results of POST Request in Browser Window via Browser Console.md

#js

  1. Open network tab in #dev-tools
  2. Right click on request and copy as fetch
  3. Add the .then() part to the fetch() and send the request
  4. Result will be inserted in browser main window
fetch("https://teeeeeessssstttttt.com/ticket/", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "en-US,en;q=0.9,de;q=0.8",
    "cache-control": "no-cache",
    "content-type": "application/x-www-form-urlencoded",
    "pragma": "no-cache",
    "sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "x-requested-with": "XMLHttpRequest",
  },
  "referrer": "https://teeeeeessssstttttt.com/checklist/a42dd04d-70d3-4f5b-938b-69c718848ac9?data%5Bsave%5D=",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"data\":{\"entscheidung\":\"nein\",\"anmerkung\":\"cvncnxcvn\",\"reset\":false,\"save\":true},\"metadata\":{\"timezone\":\"Europe/Berlin\",\"offset\":120,\"origin\":\"https://teeeeeessssstttttt.com\",\"referrer\":\"https://teeeeeessssstttttt.com/checklist/a42dd04d-70d3-4f5b-938b-69c718848ac9\",\"browserName\":\"Netscape\",\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\",\"pathName\":\"/checklist/a42dd04d-70d3-4f5b-938b-69c718848ac9\",\"onLine\":true},\"state\":\"submitted\"}",
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
}).then(
    function(response) {
        response.text().then(function(data) {
            document.open();
            document.write(data);
            document.close();
           // document.getElementsByTagName("html")[0].innerHTML = data
        });
    });

#debug #html results after #post #request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment