Send POST AJAX request from Office Add-In

Viewed 5321

I'm trying to send POST Ajax request for third party service from my Outlook Add-in, but no matter what I tried I receiving Error: Access is denied, and status 0 (request never hit the server).

Assuming we are running IE9 or 8 behind the outlook I tried old school hacks like https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest.

$.ajax({
    url: endpoint,
    data: JSON.stringify({'1':'2'}),
    // headers: {'X-Requested-With': 'XMLHttpRequest'},
    contentType: 'text/plain',
    type: 'POST',
    dataType: 'json',
    error: function(xhr, status, error) {
        // error
      }
}).done(function(data) {
    // done
  });

Is there is something more I need to implement? Of cause I add my domain to manifest AppDomain property.

Cheers

1 Answers
Related