Last active
February 22, 2023 16:59
-
-
Save alexewerlof/fedfe80d59aa1c096267600595ba423e to your computer and use it in GitHub Desktop.
Revisions
-
userpixel revised this gist
Aug 6, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ const fetch = require('node-fetch') const am = require('am') async function main() { const url = 'https://www.example.com' -
userpixel revised this gist
Jun 1, 2020 . 1 changed file with 5 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,12 @@ const fetch = require('node-fetch') comst am = require('am') async function main() { const url = 'https://www.example.com' const response = await fetch(url) const responseHeaders = Object.fromEntries(resp.headers.entries()) console.dir(responseHeaders) return responseHeaders } am(main) -
userpixel renamed this gist
Apr 25, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
userpixel created this gist
Apr 25, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ const fetch = require('node-fetch') function responseHeadersAsObject(response) { const headers = {} const keyVals = [...response.headers.entries()] keyVals.forEach(([key, val]) => { console.log(`${key}: ${val}`) headers[key] = val }) return headers } async function main() { const url = 'https://www.aol.com' const response = await fetch(url) const responseHeaders = responseHeadersAsObject(response) return responseHeaders } main().then(console.log, console.error)