RUS  ENG 

Макрос на javascript

Страницы: 1
RSS
Макрос на javascript
 
Добрый день (вечер).
Пытаюсь сделать запрос к HTTP сервису 1С
на VBScript
Sub http
Dim xmlhttp
Set xmlhttp = CreateObject("Msxml2.XMLHTTP.6.0") ' Or "Msxml2.XMLHTTP" for older systems

' --- For a GET request ---
xmlhttp.Open "GET" , "http://192.168.x.x:8008/Dokument/hs/document/list/?@format=JSON,False,user,pass;
xmlhttp.Send
' Check the status and get the response
If xmlhttp.Status = 200 Then
MsgBox "Response Text: " & xmlhttp.ResponseText
MsgBox len(xmlhttp.ResponseText)
Else
MsgBox "Error: " & xmlhttp.Status & " - " & xmlhttp.StatusText
End If
End Sub
Запрос работает в ответ приходит json в виде текста длиной около миллиона, поддержки json в VBScript нет, пытаюсь выполнить запрос на javascript где есть поддержка json

var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',False,'user','pass' );
........
ошибка new XMLHttpRequest(); определение отсутствует
через fetch
var response = fetch('http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',{ method:"GET",body: new URLSearchParams({ username: "userr", password: "pass" })});
ошибка new URLSearchParams; определение отсутствует
Как определить эти объекты?
Страницы: 1