Http request not working ? "Unauthorized"

Hy guys. Soo this is my code

[{"id":"36695f05.8b831","type":"http in","z":"24c290d1.45e2","name":"","url":"/ficheiro","method":"post","upload":true,"swaggerDoc":"","x":110,"y":920,"wires":[["8abe5d58.c887e","9af5bb14.ae2378"]]},{"id":"10feb233.f83bfe","type":"http response","z":"24c290d1.45e2","name":"","statusCode":"","headers":{},"x":490,"y":920,"wires":[]},{"id":"8abe5d58.c887e","type":"debug","z":"24c290d1.45e2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"req","targetType":"msg","x":300,"y":960,"wires":[]},{"id":"725b0dd0.c50464","type":"inject","z":"24c290d1.45e2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":1020,"wires":[["ffb5bbef.66bce8"]]},{"id":"d6a5785c.aa03f8","type":"function","z":"24c290d1.45e2","name":"Format the header and payload","func":"msg.headers = {\n    \"Content-Type\": \"multipart/form-data; boundary=------------------------d74496d66958873e\"\n}\n\n\nmsg.payload = '--------------------------d74496d66958873e\\r\\n'+\n'Content-Disposition: form-data; name=\"select\"\\r\\n'+\n'\\r\\n'+\n'true\\r\\n'+\n'--------------------------d74496d66958873e\\r\\n'+\n'Content-Disposition: form-data; name=\"print\"\\r\\n'+\n'\\r\\n'+\n'true\\r\\n'+\n'--------------------------d74496d66958873e\\r\\n'+\n'Content-Disposition: form-data; name=\"file\"; filename=\"'+msg.filename+'\"\\r\\n'+\n'Content-Type: application/octet-stream\\r\\n'+\n'\\r\\n'+\nmsg.payload+'\\r\\n'+\n'--------------------------d74496d66958873e--\\r\\n';\n\n\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":1080,"wires":[["8222024e.36291"]]},{"id":"8222024e.36291","type":"http request","z":"24c290d1.45e2","name":"","method":"POST","ret":"txt","paytoqs":false,"url":"http://192.168.1.223:1881/ficheiro","tls":"","proxy":"","x":510,"y":1080,"wires":[["92f33d8d.55e8b"]]},{"id":"92f33d8d.55e8b","type":"debug","z":"24c290d1.45e2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":1080,"wires":[]},{"id":"9af5bb14.ae2378","type":"change","z":"24c290d1.45e2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"okay","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":920,"wires":[["10feb233.f83bfe"]]},{"id":"ffb5bbef.66bce8","type":"file in","z":"24c290d1.45e2","name":"","filename":"/home/nodered/temp.txt","format":"","chunk":false,"sendError":false,"x":350,"y":1020,"wires":[["d6a5785c.aa03f8"]]}]

And I don't understand why it gives me "Unauthorized" on debug. My node-red ip is : http://192.168.1.223:1881/

Two things to check.

  1. Have you changed the authorisation settings in settings.js? If so, did you read the info in that file?
  2. Where is the client browser in relation to the Node-RED server? Are they on the same device or same network? If not, and if you haven't applied Node-RED authorisation, you have a firewall or some other device getting in the way.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.