Create a gist now

Instantly share code, notes, and snippets.

@algenon /suggest.vbs
Last active Dec 19, 2016

What would you like to do?
Пример работы с подсказками DaData на VBScript
Dim http
Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
timeout = 2000 'milliseconds
http.SetTimeouts timeout, timeout, timeout, timeout
query = "Moskva"
request = "{ ""query"": "" " & query & " "" } "
http.Open "POST", "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address"
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