Perhaps you were thinking of OData.request(…)? That may work as well although I haven't tried it.
You can try something like the following which creates an application connection with all default settings (you can change these if you want) for the default HWC application installed with the server. Change the application ID in the URL and/or username/password to match your system. I just tried this against one of my test systems and see user "supAdmin" created for the HWC application.
<html>
<head>
<script type="text/javascript">
function Login()
{
var xmlhttp = new XMLHttpRequest();
var serviceURI = "http://xxx.xxx.xxx.xxx:8000/odata/applications/v1/HWC/Connections";
var data = "<?xml version='1.0' encoding='UTF-8'?>\r\n<entry xmlns='http://www.w3.org/2005/Atom' xmlns:m='http://schemas.microsoft.com/ado/2007/08/dataservices/metadata' xmlns:d='http://schemas.microsoft.com/ado/2007/08/dataservices'>\r\n<content type='application/xml'><m:properties/></content></entry>";
var basicAuth = "Basic " + btoa("supAdmin:XXXXXXX");
xmlhttp.open("POST", serviceURI, false);
xmlhttp.setRequestHeader("X-SUP-DOMAIN", "default");
xmlhttp.setRequestHeader("Content-type","application/atom+xml; charset=UTF-8");
xmlhttp.setRequestHeader("Authorization", basicAuth);
xmlhttp.onreadystatechange = function() {
alert("OnReadystatechange + " + xmlhttp.readyState + " " + xmlhttp.status);
if (xmlhttp.readyState == 4) {
if ( xmlhttp.status == 201) {
alert("Application Connection created. Check SCC");
}
}
else {
alert(xmlhttp.responsetext);
}
};
xmlhttp.send(data);
}
</script>
</head>
<body>
<input type="button" value="Click me" onclick="javascript:Login();"/>
</body>
</html>
Thanks,
Andrew.