vmag
Active Member
What am I doing wrong?
I'm translating the code from VB
to B4A
there are no errors, but the application does not work
I'm translating the code from VB
ASP.net:
Dim myUrl As String
Dim answer As String
myUrl = "https://...."
Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("MSXML2.XMLHTTP")
WinHttpReq.Open "GET", myUrl, False
WinHttpReq.setRequestHeader "Content-Type:", "application/json"
WinHttpReq.setRequestHeader "X-API-KEY:", "abcdef........"
WinHttpReq.send
answer = WinHttpReq.responseText
B4X:
Dim http As HttpJob
Dim url As String
url = "https://..."
http.Initialize("",Me)
http.PostString(url,"")
http.GetRequest.SetHeader("Content-Type:", "application/json")
http.GetRequest.SetHeader("X-API-KEY:", "abcdef........"")
txtAnsv.text=http.GetString