# POST method with variables for WebView?

**URL:** <https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889>\
**Category:** General\
**Created:** [May 24, 2017, 10:31am UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889 "2017-05-24T10:31:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [May 24, 2017, 10:31am UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/1 "2017-05-24T10:31:53Z")

</div>

Hello! Is there a way to open WebView URL with POST method and variables?

---

<div class="post-metadata">

**Author:** ![Noah\_Hall](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/noah_hall/32/601_2.png) [@Noah\_Hall](https://forums.fusetools.com/u/Noah_Hall)\
**Post date:** [May 24, 2017, 10:58am UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/2 "2017-05-24T10:58:00Z")

</div>

Hi Matti,

Sort of. What do you want to do? It’s possible that you might just want to use the [HTTP](https://www.fusetools.com/docs/fusejs/http) package, then load the returned HTML from your server into the webview.

---

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [May 24, 2017, 11:03am UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/3 "2017-05-24T11:03:43Z")

</div>

I’d like to redirect the user to a certain page with POST variables attached. I didn’t find a method in the WebView, but I solved this by creating a basic FORM with automatic Javascript submit and pushing this to the WebView.

---

<div class="post-metadata">

**Author:** ![Daniel\_Res](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@Daniel\_Res](https://forums.fusetools.com/u/Daniel_Res)\
**Post date:** [June 29, 2017, 7:23pm UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/4 "2017-06-29T19:23:09Z")

</div>

Hi Matti.

I find myself in the same situation

Could you show me how you solved it?

Thank you

---

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [June 29, 2017, 7:52pm UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/5 "2017-06-29T19:52:34Z")

</div>

Hello! The WebView has a LoadHtml method which enables to load an HTML string to the WebView and render it. So, I’m basically pushing a Form with JavaScript (to trigger the Form automatically) to the WebView. I don’t have the snippet at hand, but I can copy&paste it tomorrow.

---

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [June 30, 2017, 6:29am UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/6 "2017-06-30T06:29:10Z")

</div>

```auto
var form = "<form action='https://example.com/form.php' id='form' method='post'>";
form += "<input type='hidden' name='variable_1' value='value_1' />";
form += "<input type='hidden' name='variable_2' value='value_2' />";
form += "</form><script>document.getElementById('form').submit();</script>";
MyWebView.loadHtml(form);

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Res](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@Daniel\_Res](https://forums.fusetools.com/u/Daniel_Res)\
**Post date:** [June 30, 2017, 2:16pm UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/7 "2017-06-30T14:16:24Z")

</div>

Thank you,

It’s just what I need, it works very well

---

<div class="post-metadata">

**Author:** ![John](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@John](https://forums.fusetools.com/u/John)\
**Post date:** [July 26, 2017, 1:52pm UTC](https://forums.fusetools.com/t/post-method-with-variables-for-webview/6889/8 "2017-07-26T13:52:28Z")

</div>

Sorry for “Thread-Hijacking”:

Just wanted to leave a BIG THANK YOU!!!
