title: ajax POST Request in android cordova
body: <p>How do I do POST request in ajax if I have this example request?</p>
  
  <p>POST</p>
  
  <p>Request URL: <a href="http://api.dev.mydomain.com/test/test1.json" rel="nofollow">http://api.dev.mydomain.com/test/test1.json</a></p>
  
  <p>Request Data = (access_token=[token here]&amp;id=[id])</p>
  
  <p>Here's what I tried but I always got failed.</p>
  
  <p>tURL = Request URL</p>
  
  <p>id = tid</p>
  
  <pre><code>function addGC(tURL, tid){
  
  console.log(tURL);
  console.log("GC ID:"+tid);
  
  var url = tURL;
  
  var postData = { access_token: localStorage.token, id: tid };
  
  console.log("Final URL:"+url);
  console.log("postData:"+postData);
  
  return $.ajax({
      type: "POST",
      url: url,        
      data: postData, 
      timeout: 60 * 1000
  }).done(function (data) {
      console.log("GC added.");
  }).fail(function () {
      console.log("GC failed.");
  }); 
  </code></pre>
  
  <p>}</p>