Is there a way to set common HTTP request headers for the whole workflow?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/nodered

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Scout APM - Truly a developer’s best friend
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • talent.io - Download talent.io’s Tech Salary Report
  • Node RED

    Low-code programming for event-driven applications

    [{"id":"6b2f788aaa4ce80b","type":"function","z":"2d37aab2.faf71e","name":"format cookies/headers","func":"// comment out the below line to use the http request nodes editor to select the method\nmsg.method = \"GET\";\n//msg.method = \"POST\";\n//msg.method = \"PUT\";\n//msg.method = \"DELETE\";\n//msg.method = \"HEAD\";\n\n// comment out the below line to use the http request nodes editor to select the url\nmsg.url = \"https://nodered.org\";\n\nmsg.headers = {};\nmsg.headers[\"User-Agent\"] = global.get(\"userAgent\", \"file\");\n\nmsg.cookies = global.get(\"cookie\", \"file\");\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":760,"wires":[["e846f404ae8e78a6"]]},{"id":"5a57788862c8ac6b","type":"function","z":"2d37aab2.faf71e","name":"set global cookies/userAgent","func":"if (typeof msg.userAgent == \"string\") {\n global.set(\"userAgent\", msg.userAgent, \"file\");\n} else {\n node.error(\"msg.userAgent must be a string\");\n};\n\nif (typeof msg.cookie == \"object\") {\n global.set(\"cookie\", msg.cookie, \"file\");\n} else {\n node.error(\"msg.cookie must be an object\");\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":720,"wires":[["3869f26e82ca82c3"]]},{"id":"fb66b6db9cc6f7f1","type":"inject","z":"2d37aab2.faf71e","name":"examples","props":[{"p":"userAgent","v":"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0\"","vt":"str"},{"p":"cookie","v":"{\"example\": \"This is just an example cookie.\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":300,"y":720,"wires":[["5a57788862c8ac6b"]]},{"id":"7f1fb81d526efa9a","type":"inject","z":"2d37aab2.faf71e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":310,"y":760,"wires":[["6b2f788aaa4ce80b"]]},{"id":"e846f404ae8e78a6","type":"http request","z":"2d37aab2.faf71e","name":"","method":"use","ret":"txt","paytoqs":"body","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":710,"y":760,"wires":[["26937a6179fa1663"]]},{"id":"26937a6179fa1663","type":"debug","z":"2d37aab2.faf71e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":760,"wires":[]},{"id":"3869f26e82ca82c3","type":"debug","z":"2d37aab2.faf71e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":720,"wires":[]},{"id":"e0bc6038c6489543","type":"comment","z":"2d37aab2.faf71e","name":"You will want to change these examples","info":"","x":210,"y":680,"wires":[]}]

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts