-
-
Save joepie91/a36133c8daba6cec2464 to your computer and use it in GitHub Desktop.
This file contains 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 characters
function http_get(url, { "User-Agent" = "kitchen sink 2.0" }, { sayHi, verbose: v }) { | |
if (sayHi) { | |
console.log("HI!"); | |
} | |
if (v) { | |
console.log("Sending request"); | |
} | |
return require('http').get({ | |
url, | |
headers: arguments[1] | |
}); | |
} | |
http_get("http://icanhazip.com", { "Accept": "love, gzip", "User-Agent": "NotTheKitchenSink" }, { true, sayHi: false }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment