Dim jobLogin As HttpJob
jobLogin.Initialize("JobLogin", Me)
jobLogin.PostString("https://XXXX.com/login","")
jobLogin.GetRequest.SetHeader("X-User", strUser)
jobLogin.GetRequest.SetHeader("X-Password", strPass)
jobLogin.GetRequest.SetHeader("Accept", "application/json")
Wait For (jobLogin) JobDone(jobLogin As HttpJob)
If jobLogin.Success = True Then
If jobLogin.GetString = "{}" Then
MsgboxAsync("Invalid Username or Password", "Login")
Wait For MsgBox_Result (Result As Int)
CallSub(Me,"LogIn")
Else
Dim JSON As JSONParser
Dim Map1 As Map
JSON.Initialize(jobLogin.GetString)
Map1 = JSON.NextObject
strApiKey = Map1.Get("token")
Log(strApiKey)
ToastMessageShow(strApiKey, True)
End If
End If