# Http request shelly Cloud

**URL:** <https://discourse.nodered.org/t/http-request-shelly-cloud/17654>\
**Category:** General\
**Created:** [7 November 2019 21:36 UTC](https://discourse.nodered.org/t/http-request-shelly-cloud/17654 "2019-11-07T21:36:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cichy28](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cichy28/32/15096_2.png) [@cichy28](https://discourse.nodered.org/u/cichy28)\
**Post date:** [7 November 2019 21:36 UTC](https://discourse.nodered.org/t/http-request-shelly-cloud/17654/1 "2019-11-07T21:36:17Z")

</div>

Hello  
I have a problem with sending proper https request to Shelly Cloud. I have configured everything like it is said in documentation to the device ([https://shelly.cloud/support/shelly-cloud-api-access/](https://shelly.cloud/support/shelly-cloud-api-access/)) and when I am using postman it is ok but when I did the same configuration in node-red it doesn't work.  
I have used Fiddler trying to see what is the difference and it doesn't look like in node-red debugger window. I noticed that I should add some headers but I do not know which one and I wonder why in fact I have to do that (i didn't add any headers in postman). I have tried to copy headers from postman but without any result Can anyone help me with this problem and explain what I did wrong?  
Thank you in advance for help  
Postman results

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/83dd44a2da429455aa337b23ac761f9afd634f10.png)  
Node-red request results:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e6f13328220dd10415f79b219eb6ccef30cbbb52.png)

---

<div class="post-metadata">

**Author:** ![jakadia](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@jakadia](https://discourse.nodered.org/u/jakadia)\
**Post date:** [23 April 2021 14:05 UTC](https://discourse.nodered.org/t/http-request-shelly-cloud/17654/2 "2021-04-23T14:05:03Z")

</div>

I know you probably already figured this out, but better late than never!

set `msg.headers={"content-type":"application/x-www-form-urlencoded"}`  
set `msg.payload={"id":"[device_id]","auth_key":"[auth_key]"}`

Example flow - `[{"id":"5415b568.ecd0dc","type":"inject","z":"ef648c79.ead65","name":"ON","props":[{"p":"statusState","v":"on","vt":"str"},{"p":"headers","v":"{\"content-type\":\"application/x-www-form-urlencoded\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":270,"y":1860,"wires":[["6a27a033.7ccb4"]]},{"id":"118448be.709267","type":"http request","z":"ef648c79.ead65","name":"ON/OFF","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://shelly-23-eu.shelly.cloud/device/relay/control/","tls":"","persist":true,"proxy":"","authType":"","x":640,"y":1880,"wires":[["62d0a84f.201df8"]]},{"id":"62d0a84f.201df8","type":"debug","z":"ef648c79.ead65","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":1880,"wires":[]},{"id":"6a27a033.7ccb4","type":"function","z":"ef648c79.ead65","name":"","func":"var1 = msg.statusState;\n\nmsg.payload = {\n \"channel\":\"0\",\n \"turn\":var1,\n \"id\":\"27cf76f3f60b\",\n \"auth_key\":\"NjY4Yzd1akldhmEA91B2720BB54fdgh816EBFF5F46F6dfyf16106D32JGH886GD49126E49CAFBC99536363CF69E\"}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":1880,"wires":[["118448be.709267"]]},{"id":"ba6bf165.7f8f","type":"inject","z":"ef648c79.ead65","name":"OFF","props":[{"p":"statusState","v":"off","vt":"str"},{"p":"headers","v":"{\"content-type\":\"application/x-www-form-urlencoded\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":270,"y":1900,"wires":[["6a27a033.7ccb4"]]}]`

In the HTTP request node set your url to the one you want to hit and select POST, you should be good to go!

Thanks  
Jake
