Добрый день (вечер).
Пытаюсь сделать запрос к 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" , "[URL=http://192.168.x.x:8008/Dokument/hs/document/list/?@format=JSON,False,user]http://192.168.x.x:8008/Dokument/hs/document/list/?@format=JSON,False,user[/URL],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', '[URL=http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',False,'user','pass']http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',False,'user','pass'[/URL] );
........
ошибка new XMLHttpRequest(); определение отсутствует
через fetch
var response = fetch('[URL=http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',]http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',[/URL]{ method:"GET",body: new URLSearchParams({ username: "userr", password: "pass" })});
ошибка new URLSearchParams; определение отсутствует
Как определить эти объекты?
Пытаюсь сделать запрос к 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" , "[URL=http://192.168.x.x:8008/Dokument/hs/document/list/?@format=JSON,False,user]http://192.168.x.x:8008/Dokument/hs/document/list/?@format=JSON,False,user[/URL],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', '[URL=http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',False,'user','pass']http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',False,'user','pass'[/URL] );
........
ошибка new XMLHttpRequest(); определение отсутствует
через fetch
var response = fetch('[URL=http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',]http://192.168.33.1:8008/Dokument/hs/document/list/?@format=JSON',[/URL]{ method:"GET",body: new URLSearchParams({ username: "userr", password: "pass" })});
ошибка new URLSearchParams; определение отсутствует
Как определить эти объекты?