0

I am developing a plugin for the desktop version of drawio. The objective is to be able to make a request to a web service with the generated XML. I have tried different methods but have not succeeded. Is it possible that a request cannot be made from drawio?

I have tried with fetch, XMLHttpRequest (), but I have not obtained any results, I think it is because drawio does not support it.

I have also tried the methods that drawio provides. mxXmlRequest. Example I have used:

var onload = function (req) {
  //mxUtils.alert (req.getStatus ());
  mxUtils.popup (req, true);
}

var onerror = function (req) {
  mxUtils.alert ('Error');
}

new mxXmlRequest('https://chowlk.linkeddata.es/api', final, 'POST')
  .send(onload, onerror);

Does anyone know how to solve my problem?

Thanks

blex
  • 24,941
  • 5
  • 39
  • 72
H_2525
  • 11
  • 2
  • So what exactly error you got? What documentation are you using? – Justinas May 07 '21 at 10:27
  • The desktop version restricts comms by applying a CSP to the web view. You'd need to adapt the build in order to allow this. – Frodo Baggins May 07 '21 at 10:42
  • @Justinas I do not receive any errors. I receive an empty message / reply. The documentation that I am using is the following https://jgraph.github.io/mxgraph/docs/js-api/files/util/mxXmlRequest-js.html#mxXmlRequest.request – H_2525 May 07 '21 at 11:04

0 Answers0