# Http request not working ? "Unauthorized"

**URL:** <https://discourse.nodered.org/t/http-request-not-working-unauthorized/23539>\
**Category:** General\
**Created:** [24 March 2020 01:29 UTC](https://discourse.nodered.org/t/http-request-not-working-unauthorized/23539 "2020-03-24T01:29:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucasSaraivaAzevedo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lucassaraivaazevedo/32/8686_2.png) [@LucasSaraivaAzevedo](https://discourse.nodered.org/u/LucasSaraivaAzevedo)\
**Post date:** [24 March 2020 01:29 UTC](https://discourse.nodered.org/t/http-request-not-working-unauthorized/23539/1 "2020-03-24T01:29:41Z")

</div>

Hy guys. Soo this is my code

```auto
[{"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/](http://192.168.1.223:1881/)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [24 March 2020 21:17 UTC](https://discourse.nodered.org/t/http-request-not-working-unauthorized/23539/2 "2020-03-24T21:17:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 May 2020 06:10 UTC](https://discourse.nodered.org/t/http-request-not-working-unauthorized/23539/4 "2020-05-24T06:10:29Z")

</div>

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