7

I want to integrate a webviewer component in an appinventor app.

I want the app to POST something to already prepared PHP script. I do not want to use GET. So PHP on server looks like:

<?php echo $_POST['value']; ?>

My appinventor block looks like:

enter image description here

This is NOT working. Any help appreciated. Thanks.

EDIT: 2nd try. Thank you @YiWei. enter image description here

Taifun
  • 6,165
  • 17
  • 60
  • 188
Karel Borovský
  • 79
  • 1
  • 1
  • 4

2 Answers2

4

add requestheaders:content-type:application/x-www-form-urlencoded and buildrequestData

enter image description here

Taifun
  • 6,165
  • 17
  • 60
  • 188
YiWei
  • 41
  • 1
2

the webviewer only can do GET
this should work:

enter image description here

using the web component, you get the result back in the Web.GotText event enter image description here

see also the documentation

Taifun
  • 6,165
  • 17
  • 60
  • 188
  • This, of course, is working. But I do not want to use get. So you mean, that it is not possible to send the data through POST? Is there any other way to send security sensitive data from app to web? – Karel Borovský Oct 27 '14 at 17:05
  • just use only the `web`component as you did in the example, there is no need to use a `webviewer` component... – Taifun Oct 27 '14 at 17:49
  • 2
    but i want the viewer to be part of the app. How can I get back the result if I use the POST? Any working example? – Karel Borovský Oct 27 '14 at 18:20