# Need help with curl

**URL:** <https://discourse.nodered.org/t/need-help-with-curl/38279>\
**Category:** General\
**Created:** [30 December 2020 12:32 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279 "2020-12-30T12:32:18Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![bigmac5753](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bigmac5753/32/15733_2.png) [@bigmac5753](https://discourse.nodered.org/u/bigmac5753)\
**Post date:** [31 December 2020 11:41 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/21 "2020-12-31T11:41:16Z")

</div>

unfortunately not, here's the flow I tried...

```auto
[{"id":"5f5ddec5.0b319","type":"inject","z":"dee1ee38.a66f9","name":"","props":[{"p":"payload.url","v":"https://www.youtube.com/watch?v=6jAb8Bzrs8U","vt":"str"},{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{}","payloadType":"json","x":270,"y":1340,"wires":[["8ae270f7.a50ac"]]},{"id":"8ae270f7.a50ac","type":"http request","z":"dee1ee38.a66f9","name":"","method":"POST","ret":"txt","paytoqs":"body","url":"http://192.168.0.2:8080/youtube-dl/q","tls":"","persist":false,"proxy":"","authType":"","x":730,"y":1340,"wires":[["ec958872.6803e8"]]},{"id":"ec958872.6803e8","type":"debug","z":"dee1ee38.a66f9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":1340,"wires":[]},{"id":"fd802efe.8e94a","type":"change","z":"dee1ee38.a66f9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$encodeUrl(\"url=\" & payload.url)","tot":"jsonata"},{"t":"set","p":"headers[\"content-type\"]","pt":"msg","to":" application/x-www-form-urlencoded","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1340,"wires":[[]]}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [31 December 2020 11:43 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/22 "2020-12-31T11:43:36Z")

</div>

Your change node is not connect to the inject you bypassed the change

And in the change node you overwrite payload.url, when you set msg.payload to {}

---

<div class="post-metadata">

**Author:** ![bigmac5753](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bigmac5753/32/15733_2.png) [@bigmac5753](https://discourse.nodered.org/u/bigmac5753)\
**Post date:** [31 December 2020 11:49 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/23 "2020-12-31T11:49:44Z")

</div>

I just assumed I had to use the same inject settings. So what exactly do I need to change?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [31 December 2020 11:50 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/24 "2020-12-31T11:50:38Z")

</div>

just delete set msg.payoad to {}

---

<div class="post-metadata">

**Author:** ![bigmac5753](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bigmac5753/32/15733_2.png) [@bigmac5753](https://discourse.nodered.org/u/bigmac5753)\
**Post date:** [31 December 2020 11:55 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/25 "2020-12-31T11:55:00Z")

</div>

If this is what you mean:

```auto
[{"id":"5f5ddec5.0b319","type":"inject","z":"dee1ee38.a66f9","name":"","props":[{"p":"payload.url","v":"https://www.youtube.com/watch?v=6jAb8Bzrs8U","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":270,"y":1340,"wires":[["8ae270f7.a50ac"]]},{"id":"8ae270f7.a50ac","type":"http request","z":"dee1ee38.a66f9","name":"","method":"POST","ret":"txt","paytoqs":"body","url":"http://192.168.0.2:8080/youtube-dl/q","tls":"","persist":false,"proxy":"","authType":"","x":730,"y":1340,"wires":[["ec958872.6803e8"]]},{"id":"ec958872.6803e8","type":"debug","z":"dee1ee38.a66f9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":1340,"wires":[]},{"id":"fd802efe.8e94a","type":"change","z":"dee1ee38.a66f9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$encodeUrl(\"url=\" & payload.url)","tot":"jsonata"},{"t":"set","p":"headers[\"content-type\"]","pt":"msg","to":" application/x-www-form-urlencoded","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1340,"wires":[[]]}]

```

It doesn't work

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [31 December 2020 11:56 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/26 "2020-12-31T11:56:44Z")

</div>

Your change node is unconnected drag it down to see.

---

<div class="post-metadata">

**Author:** ![bigmac5753](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bigmac5753/32/15733_2.png) [@bigmac5753](https://discourse.nodered.org/u/bigmac5753)\
**Post date:** [31 December 2020 12:00 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/27 "2020-12-31T12:00:13Z")

</div>

schoolboy error! 😳

Thanks, it's working

---

<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:** [1 March 2021 12:00 UTC](https://discourse.nodered.org/t/need-help-with-curl/38279/28 "2021-03-01T12:00:26Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/need-help-with-curl/38279.md?page=1)
