iOS, HttpClient, POST with 302 redirect

You must Login before you can answer or comment on any questions.

Hi, I'm having a problem with HttpClient. Everything is working fine on simulator but on iphone 3GS(5.0.1) I get "request failed because redirected too many times".

On my apache access logs I see that there is only one call with 302 return code.

var http_client = Titanium.Network.createHTTPClient({autoRedirect:true});
                http_client.onload = function(e) {
                //if (http_client.readyState==4 && http_client.status==200){
                        alert(this.responseText);
                        var data = JSON.parse(this.responseText);
 
                        OAuth2.code = data.code;
                    //} 
                };
    http_client.open('POST','xxx');
            http_client.setRequestHeader("Content-type","application/x-www-form-urlencoded")
            http_client.send('username=' +textFieldLogin.value + '&password=' + textFieldPassword.value);
any solution ? looks like a bug in titanium

— asked 12 months ago by Mateusz Jendrzyn
2 Comments
  • Which version of the Titanium SDK are you using? I want to say that I recall hearing one of t he newer SDKs fix this, but not sure.

    — commented 12 months ago by Darren Adams

  • 2.1.0.GA

    — commented 12 months ago by Mateusz Jendrzyn

1 Answer

Your Answer

This question has been locked and cannot accept new answers.