The flow looks like this:
The contents of the Nodes are as follows:
Here's the flow:
$ ppjson < .node-red/lib/flows/HTTP-GET-Example [ { "id": "e116677c.1ee998", "type": "inject", "z": "c85b2010.37a4e", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": true, "x": 120, "y": 80, "wires": [ [ "9367f7e8.6c9808" ] ] }, { "id": "998e7b3.f667188", "type": "debug", "z": "c85b2010.37a4e", "name": "", "active": true, "console": "false", "complete": "payload", "x": 690, "y": 160, "wires": [] }, { "id": "9367f7e8.6c9808", "type": "function", "z": "c85b2010.37a4e", "name": "Date to String", "func": "var d = new Date(msg.payload);\nmsg.date = d.toISOString();\nreturn msg;", "outputs": 1, "noerr": 0, "x": 280, "y": 80, "wires": [ [ "4919d9e7.b6e628" ] ] }, { "id": "efc196dc.103e68", "type": "http in", "z": "c85b2010.37a4e", "name": "", "url": "/hello", "method": "get", "swaggerDoc": "", "x": 100, "y": 160, "wires": [ [ "fcc0e674.033f18" ] ] }, { "id": "fcc0e674.033f18", "type": "http response", "z": "c85b2010.37a4e", "name": "", "x": 250, "y": 160, "wires": [] }, { "id": "4919d9e7.b6e628", "type": "http request", "z": "c85b2010.37a4e", "name": "", "method": "GET", "ret": "txt", "url": "http://localhost:1880/hello?ts={{date}}", "tls": "", "x": 510, "y": 80, "wires": [ [ "46464921.b9b9b8" ] ] }, { "id": "33b01e6d.cc4fe2", "type": "comment", "z": "c85b2010.37a4e", "name": "1. Format a Time Stamp String, trigger HTTP GET", "info": "", "x": 230, "y": 40, "wires": [] }, { "id": "46464921.b9b9b8", "type": "function", "z": "c85b2010.37a4e", "name": "Add Status Code", "func": "msg.payload = JSON.parse(msg.payload);\nmsg.payload.statusCode = msg.statusCode;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 690, "y": 80, "wires": [ [ "998e7b3.f667188" ] ] }, { "id": "b740a4d8.48bf58", "type": "comment", "z": "c85b2010.37a4e", "name": "3. Respond to the HTTP Request", "info": "", "x": 170, "y": 120, "wires": [] }, { "id": "ca38baaa.35c748", "type": "comment", "z": "c85b2010.37a4e", "name": "2. Pick up the Response, Add Status Code", "info": "", "x": 600, "y": 40, "wires": [] }, { "id": "aa43884c.55bc78", "type": "comment", "z": "c85b2010.37a4e", "name": "4. Display the Date and Status Code", "info": "", "x": 580, "y": 120, "wires": [] } ]