title: Post JSON data to external URL
body: <p>How do you post JSON data as a url string to an external url (cross domains) and bypass Access Control?</p>
  
  <p>Here is a jquery .ajax post request that won't work sending to an external url because of Access-Control-Allow-Origin:</p>
  
  <pre><code>var json = JSON.stringify(object);
  
  $.ajax({
    type: 'POST',
    url: externalurl,
    data: json,
    dataType: 'json',
    success: function(data){console.log(data);},
    failure: function(errMsg) {
        console.log(errMsg);
    },
  });
  </code></pre>
  
  <p>I have received a suggestion to POST the data to the same domain and 'pass on the request' to the external domain, though this solution doesn't make sense to me. I am looking for the most secure solution. Any help would be much appreciated.</p>