Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

integrating a web service

$
0
0

Hi all I am trying to integrate a webservice but when I press the button to call it my log is terminated and my app freezes. I am getting no error messages. Below is my code:

Post_array.push({
            variable1:value1,
            variable2:value2
            variable3:value3
        });
 
 
        var AddJobURL="http:/NUMBERS/MytestURL";
        var AddJobxhr=Titanium.Network.createHTTPClient();
 
        AddJobxhr.onload=function(){
            console.log("Response text ----------------------"+ this.responseText);
            var doc= JSON.parse(this.responseText);
        };
 
        AddJobxhr.onerror=function(e){
            alert(e.error);
        };
 
        AddJobxhr.open('POST', AddJobURL);
        AddJobxhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        AddJobxhr.send(Post_array);

Viewing all articles
Browse latest Browse all 7655

Trending Articles