Last active
April 9, 2024 03:22
-
-
Save nalgeon/195b6f69a3901262caa033a360c199b6 to your computer and use it in GitHub Desktop.
Пример работы с подсказками DaData на VBScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim http | |
Set http = CreateObject("WinHttp.WinHttpRequest.5.1") | |
timeout = 2000 'milliseconds | |
http.SetTimeouts timeout, timeout, timeout, timeout | |
query = "7719402047" | |
request = "{ ""query"": """ & query & """ } " | |
http.Open "POST", "https://suggestions.dadata.ru/suggestions/api/4_1/rs/findById/party" | |
http.SetRequestHeader "Content-Type", "application/json" | |
http.SetRequestHeader "Authorization", "Token ВАШ_API_ключ" | |
http.Send request | |
resp = http.ResponseText | |
WScript.Echo resp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment