# Posting form data with function

**URL:** https://discourse.nodered.org/t/posting-form-data-with-function/20790
**Category:** General
**Created:** [24 January 2020 00:15 UTC](https://discourse.nodered.org/t/posting-form-data-with-function/20790 "2020-01-24T00:15:44Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![brunoamaral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/brunoamaral/32/16112_2.png) [@brunoamaral](https://discourse.nodered.org/u/brunoamaral)
#### Post date: [24 January 2020 10:24 UTC](https://discourse.nodered.org/t/posting-form-data-with-function/20790/5 "2020-01-24T10:24:21Z")

</div>

Thank you @knolleary, that was it.

I still had to keep one of the headers, but the code below works:

```auto
var payload = msg.payload;

var data = { 'url': payload.content,'format': 'bestvideo' };

msg.headers = {
'content-type':'application/x-www-form-urlencoded'
}
msg.payload = data;
return msg;

```

---

_[View the full topic](https://discourse.nodered.org/t/posting-form-data-with-function/20790)._
