I would like to call a browser (that is not visible on the window, I need it only for the request send) to go to a specified url, with POST data in it.
goToUrl has 3 parameters, first is the address itself, second is the headers and third is the post data.
My question is: how should I set the headers, and what type of data should I put in the postData MemoryBlock to be able to get the POST results in the destination php page?
Some code, maybe it helps to debug:
[color=#00BF00]//the MemoryBlock I want to send[/color]
MemoryBlock* toPost = new MemoryBlock();
[color=#00BF00]// the data I want to send[/color]
StringArray* headers = new StringArray();
[color=#00BF00]// I tried to set the headers to something I found on the net
// but it must be be incorrect as it just doesn’t work[/color]
headers->add(“Content-Type = application/x-www-form-urlencoded”);
[color=#00BF00]// let’s say needPost.php just prints the POST array to the screen
// so if it would work correctly, it would show “x : y” and “u : v” or something similar [/color]
browser->goToURL( “http://something.com/needPost.php”, headers, toPost );