Last active
December 16, 2015 13:08
-
-
Save arscan/5439148 to your computer and use it in GitHub Desktop.
Simple test case for headers for hubble.
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
// node server.js | |
// should print out 3 lines each time the tests polls, 1 without special headers, 1 with 1 header, 1 with 2 headers | |
var http = require('http'); | |
http.createServer(function (req, res) { | |
console.log(JSON.stringify(req.headers)); | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end(JSON.stringify({"status":"up"})); | |
}).listen(9615); |
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
curl http://localhost:9999 \ | |
-d column=0 \ | |
-d label="No header" \ | |
-d poll_url="http://localhost:9615" \ | |
-d poll_seconds=10 \ | |
-d poll_failed="Bummer :(" \ | |
-d poll_method="json_value:^.status" | |
curl http://localhost:9999 \ | |
-d column=0 \ | |
-d label="One header" \ | |
-d poll_url="http://localhost:9615" \ | |
-d poll_header="xapi-key: dakey" \ | |
-d poll_seconds=10 \ | |
-d poll_failed="Bummer :(" \ | |
-d poll_method="json_value:^.status" | |
curl http://localhost:9999 \ | |
-d column=0 \ | |
-d label="Two header" \ | |
-d poll_url="http://localhost:9615" \ | |
-d poll_header="xapi-key: dakey" \ | |
-d poll_header="xapi-token: datoken" \ | |
-d poll_seconds=10 \ | |
-d poll_failed="Bummer :(" \ | |
-d poll_method="json_value:^.status" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment