# How to get a webpage, then submit a form using a POST request

**URL:** <https://discourse.nodered.org/t/how-to-get-a-webpage-then-submit-a-form-using-a-post-request/54754>\
**Category:** General\
**Tags:** http-request\
**Created:** [5 December 2021 18:06 UTC](https://discourse.nodered.org/t/how-to-get-a-webpage-then-submit-a-form-using-a-post-request/54754 "2021-12-05T18:06:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [5 December 2021 18:18 UTC](https://discourse.nodered.org/t/how-to-get-a-webpage-then-submit-a-form-using-a-post-request/54754/2 "2021-12-05T18:18:49Z")

</div>

you need to create a http request node that posts the form options and id with the correct headers. The url seems to be the root url. You should be able to do this in one request.  
this thread may help

> [@Posting form data with function](https://discourse.nodered.org/t/posting-form-data-with-function/20790/5):
>
> Thank you @knolleary, that was it. I still had to keep one of the headers, but the code below works: 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/how-to-get-a-webpage-then-submit-a-form-using-a-post-request/54754)._
