OpenUrl Using POST

Is possible to use POST option in openUrl function.

I need send hidden params to html page.

Thanks in advance

Can you use network.request() for that? system.openURL() says take this URL and open it in the native, default browsers.

What parameters?

Rob

Rob is on the correct track.

This is a problem even in native development, both webview and system browser usually don’t take more parameters than the URL.

most of the times you can work around this by doing the network.request manually, storing the response as HTML file, and opening that file from local storage… but it depends on the contents of the file, if it will then point to the right places - you need to check yourself.

If  in the application I am authenticated and want to spend the username and password to system.openURL() Using POST. then open the web page url authenticated.

well i suppose that depends on how the information about you being authenticated is stored and transferred between requests?

if it’s part of the HTTP payload, you can read it and create any kind of html to get you started as you like…

but it’s more likely to be stored somewhere in HTTP headers like authentication, or perhaps a cookie… then you will need to read those headers off the network request and work with them.

However I am unsure if corona’s webview allows you to set http request headers… i don’t think so… Rob, any ideas?

the only really ugly workaround would be again to use some kind of local file with added javascript that might be able to alter the http headers and make the request inside webview for you…

but that would be a pretty dirty solution with no guarantees (but yes, i’ve seen this done before, in native applications, as it was the only possible workaround)

Can you use network.request() for that? system.openURL() says take this URL and open it in the native, default browsers.

What parameters?

Rob

Rob is on the correct track.

This is a problem even in native development, both webview and system browser usually don’t take more parameters than the URL.

most of the times you can work around this by doing the network.request manually, storing the response as HTML file, and opening that file from local storage… but it depends on the contents of the file, if it will then point to the right places - you need to check yourself.

If  in the application I am authenticated and want to spend the username and password to system.openURL() Using POST. then open the web page url authenticated.

well i suppose that depends on how the information about you being authenticated is stored and transferred between requests?

if it’s part of the HTTP payload, you can read it and create any kind of html to get you started as you like…

but it’s more likely to be stored somewhere in HTTP headers like authentication, or perhaps a cookie… then you will need to read those headers off the network request and work with them.

However I am unsure if corona’s webview allows you to set http request headers… i don’t think so… Rob, any ideas?

the only really ugly workaround would be again to use some kind of local file with added javascript that might be able to alter the http headers and make the request inside webview for you…

but that would be a pretty dirty solution with no guarantees (but yes, i’ve seen this done before, in native applications, as it was the only possible workaround)