outlook - Send POST AJAX request from Office Add-In -


i'm trying send post ajax request third party service outlook add-in, no matter tried receiving error: access denied, , status 0 (request never hit server).

assuming running ie9 or 8 behind outlook tried old school hacks 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 more need implement? of cause add domain manifest appdomain property.

cheers

the following needs done send request 3rd party service ...

  • add service uri appdomain list (you've done it.)
  • the service must have ssl endpoint; "https://your.domain" must included within of "appdomain" entry (see above)
  • the service has allow cors requests application (hosted outlook app uri) domain or any domain. service creators allow or disallow client apps connections via ajax.

as of observation of code notices sending json object, setting content type "text/plain". contact service creators information on type of data accept request. services allow "application/json", not plain text.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -