I've spent hours trying to get this to work so maybe someone can confirm if I'm wasting my time.
Currently I have a script on my server that makes a call to a third party site where I pass in a username and password. That site creates a session and then redirects to another site which takes the session data along with the credentials passed and creates an authentication token. That token allows me to then make calls to their api.
My site uses curl to send the request with the following:
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('application/x-www-form-urlencoded','Connection: Keep-Alive'));
curl_setopt($curl, CURLOPT_URL, $myurl);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLINFO_HEADER_OUT, 1);
curl_setopt($curl, CURLOPT_COOKIEFILE, "");
This works perfectly on my site to get the token generated but of course when I try and achieve the same thing in godot I'm hitting a wall. Using httpRequest does not work because it will redirect without the session data and if I change "maxredirects" to zero the request does not complete (requestcompleted is never called). If I use httpClient to have more control I don't see a way to stop a redirect at all.
Any help would be appreciated. I was considering using gdnative to be able to use curl but looking at the amount of effort required, if the only option was to go that route I would probably have to avoid using godot for this particular project.