title: How to POST JSON request in cross domain in sencha touch
body: <p>I have got following URL</p>
  
  <blockquote>
    <p><a href="https://development.avalara.net/1.0/tax/get" rel="nofollow">https://development.avalara.net/1.0/tax/get</a></p>
  </blockquote>
  
  <p>and would like to POST following JSON request body</p>
  
  <pre><code>{ 
  "DocDate": "2011-05-11", 
  "CustomerCode": "CUST1", 
  "Addresses": 
  [ 
  { 
  "AddressCode": "1", 
  "Line1": "435 Ericksen Avenue Northeast", 
  "Line2": "#250", 
  "PostalCode": "98110" 
  } 
  ]
  }
  </code></pre>
  
  <p>which then will give JSON response</p>
  
  <pre><code>{ 
  "DocCode": "78b28084-8d9a-477c-9f26-afab1c0c3877", 
  "DocDate": "2011-05-11", 
  "Timestamp": "2011-05-11 04:26:41", 
  "TotalAmount": 10, 
  "TotalDiscount": 0, 
  "TotalExemption": 0, 
  "TotalTaxable": 10, 
  "TotalTax": 0.86, 
  “TotalTaxCalculated”: 0.86, 
  "TaxDate": "2011-05-11",
  .......
  }
  </code></pre>
  
  <p>I have tried to use </p>
  
  <blockquote>
    <p>Ext.Ajax.request</p>
  </blockquote>
  
  <p>but get error </p>
  
  <pre><code>Origin http://localhost is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>which might be due to having different domain.</p>
  
  <p>So, then i tried to use JSONP</p>
  
  <pre><code>Ext.data.JsonP.request
  (
  {
  url: 'https://development.avalara.net/1.0/tax/get',
  callbackName: 'test',
  method: 'POST',
  jsonData: '{"DocDate": "2011-05-11", "CustomerCode": "CUST1", "Addresses": [ { "AddressCode": "1", "Line1": "435 Ericksen Avenue Northeast","Line2": "#250", "PostalCode": "98110" } ] }' ,
  success: function(response) {
  //do some successful stuff
  Ext.Msg.alert(response);
  },
  failure: function(response) {
  //complain
  Ext.Msg.alert('fail');
  }
  });
  </code></pre>
  
  <p>But URL 404(Not Found) error is encountered and request method is GET instead of POST.</p>
  
  <p>Can anyone help me how POST request body(JSON) and obtaind JSON response from different domain?</p>
  
  <p>Thanks in advance</p>