First of all, I looked on SO already and found a similar question here:
Calling REST web services from a classic asp page
However, this doesn't solve my problem. I can't find a way to retrieve the correct information provided by my call
function determineLocationId(identifier)
Dim http: Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Dim privateKey
privateKey = "myKey"
IdentifyUrl = "https://sandbox.uberall.com/api/locations/?identifier=" & identifier & "&private_key=" & privateKey
With http
Call .Open("GET", identifyUrl, False)
Call .Send()
End With
If Left(http.Status, 1) = 2 Then
response.write("updated")
Else
'Output error
Call Response.Write("Server returned: " & http.Status & " " & http.StatusText)
End If
response.write(identifyUrl)
response.end()
determineLocationId = identifier
end function
When I print my identifyUrl
to the screen and copy & paste it into my browser, I get the correct output. A json
-formatted object with the information I need.
However, if I print http.responseBody
, it just yields some chinese chars like this:
佄呃偙⁅呈䱍倠䉕䥌⁃ⴢ⼯㍗⽃䐯䑔䠠䵔⁌⸴吠慲獮瑩潩慮⽬䔯≎∠瑨灴⼺眯睷眮⸳牯⽧剔栯浴㑬氯潯敳搮摴㸢ℼⴭ䐠瑡楥慮敭›敤慦汵獡⁰㉖〮‰㠰〮⸸〲㈱䠠湡楗汬牆楥敢杲牥ⴠ
What am I doing wrong? The link is definetly the correct one. I also tried to add:
Call .SetRequestHeader("Content-Type", "application/json")
without success