Skip to main content
Level 2
Sep 1, 2022 8:55 AM UTC
Solved

XMLHttpRequest not defined

Hello! Im trying to build an API call in the javascript node. But when I try to use the XMLHttpRequest function it says "JST-31000 XMLHttpRequest is not defined. I can't get my head around why it doesnt work.

 

var xhr = new XMLHttpRequest(); var url = "https://condst.maklasde.vitsdc.net/CRM/"; xhr.open("GET", url); xhr.setRequestHeader("Authorization", "Basic NTgaassdasdsdasdasdNVRVBzeGFmeW1nUm4="); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { console.log(xhr.status); console.log(xhr.responseText); }}; xhr.send();

 

Hope you can help out

 

Regards, Martin

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
david--garcia
david--garciaAccepted solution
Level 10
Sep 2, 2022 12:23 AM UTC

Try, you must have the domain whitelisted on the urlpermissions node on serverConf

 

 

 

var url = "https://condst.maklasde.vitsdc.net/CRM/" logInfo(url) var req = new HttpClientRequest(url); req.execute(); var resp = req.response;

 

 

https://www.linkedin.com/in/david-garcia-uk/ | https://martech.network

2 replies

david--garcia
david--garciaAccepted solution
Level 10
Sep 2, 2022 12:23 AM UTC

Try, you must have the domain whitelisted on the urlpermissions node on serverConf

 

 

 

var url = "https://condst.maklasde.vitsdc.net/CRM/" logInfo(url) var req = new HttpClientRequest(url); req.execute(); var resp = req.response;

 

 

Translate
https://www.linkedin.com/in/david-garcia-uk/ | https://martech.network
Sukrity_Wadhwa
Level 4
Sep 14, 2022 8:58 AM UTC

Hi @marting66652718,

Was the given solution helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!

Translate
Sukrity Wadhwa