app inventor 2 POST
Asked Answered
R

2

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

Reptile answered 26/10, 2014 at 10:34 Comment(1)
the suggestion of @YiWei looks fine. What do you get in the Web1.GotText event?Arcane
T
4

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

enter image description here

Tenenbaum answered 12/11, 2014 at 13:27 Comment(2)
Can you please post the image somewhere else and link it here? I really wonder if there is any working solution for this.Cache
I tried with no luck... can you please check my code? s9.postimg.org/p0riiv7qn/V_st_i_ek.pngCache
A
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

Arcane answered 26/10, 2014 at 16:48 Comment(3)
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?Cache
just use only the webcomponent as you did in the example, there is no need to use a webviewer component...Arcane
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?Cache

© 2022 - 2024 — McMap. All rights reserved.