How to pass password only to HTTP request?

I am using JavaScript in the scripting engine in a program called Directory Opus. It seems to use a flavor of JavaScript more like MS JScript. I mention that because to say not all things JavaScript (ES6) will work with what it accepts. My question is this: in a HTTP request like the code I show should I be able to pass user credentials to the open command if only a password is required? This request is for VLC player and their instructions are to leave the username blank. If put the same URL in a browser it will prompt with a password once, I will put in the password “vlcremote”, leave the username blank and it will return the status. When I use with the syntax, I show, it returns an error when the open command uses “” as a username. If I put a random user name the request returns a limited result but denies access to the data it should give. Is there a better way to do this?

function getValues(webUrl)
{
   var xhr = new ;
   var url = webUrl;
   xhr.open("GET", url, false, "", "vlcremote");
   xhr.setRequestHeader("Content-type", "text/xml");  
   xhr.setRequestHeader("Authorization", "Basic")
   xhr.send()
   DOpus.Output(xhr.readyState)
   var xmlText = xhr.responseText;
   DOpus.Output(xmlText)
}
getValues("http://127.0.0.1:8080/requests/status.xml");

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.