Welcome to the Jazz Community Forum
IBM DNG 6.0.5 Custom Widget post values via Rest

Accepted answer

function reqListener () { console.log(this.responseXML);
$("#results").append("Response: " + this.responseXML); } const req = new XMLHttpRequest(); req.addEventListener("load", reqListener); req.open("GET", "
rest/post/something"); req.send();
Comments

Thank you Davyd, this is what I got after adding your code. blank result, not sure where is failing.




1 vote

it is working know I can see the response in the console, but in the listener can't recognize the req object, how do I pass the req to the listener ?

I had a small typo in my previous example code because I copied and pasted yours. Use this
instead of req
and you should be fine
1 vote

a

I can't really see that image, but try console.log(this) instead and see what the whole object is returning.

it is printing in the widget with null if I use this.responseXML and is responding blank if I use just this.

it works now, I just needed to print as text instead of xml Thank you.
Comments
Davyd Norris
Jul 11 '19, 6:40 p.m.Rafael Rodriguez Montes
Jul 11 '19, 7:16 p.m.I'm trying to integrate with another tool, I'm using