Open url in POST method with parameter in body

Good afternoon people,


I would like to know how I can perform a POST on a URL by passing the attribute on the BODY of the page.


Parameter:

hash


Value:

base64



Thanks

Hi,

Have you tried to check the actions available in the HTTPRequestHandler extension?

Solution

Hi Nuno,


I've seen this action yes, but was unable to provide the hash parameter with the value correctly.

What happens, the site is waiting for an input with this parameter called hash, on the mobile I already managed to do it the following way and it worked, but on the web I could not adapt the logic.


----------

Code for mobile:


var pageContent = '<html><head></head><body><form id="loginForm" action="' + $parameters.Url + '" method="post">' +
'<input type="hidden" name="hash" value="' + $parameters.HashBase64 + '">' +
'</form> <script type="text/javascript">document.getElementById("loginForm").submit();</script></body></html>';
var pageContentUrl = 'data:text/html;base64,' + btoa(pageContent);

var browserRef = window.cordova.InAppBrowser.open(
    pageContentUrl ,
    $parameters.Target,
     $parameters.OptionsString
);

Solution

Have you tried to use the PostRequest_AddArgument. Here you can pass a Name and a Value and the return you can use in the PostRequest_Submit, in the Arguments input.