can someone help me to import this python script to B4J each try i have done ends in an internal server error or i don't get the token. and i have to say that i'm not a python programmer.
Sub GetToken
' Code_jOkHttpUtils2_Post_Json
Dim job As HttpJob
job.Initialize("", Me)
Dim payload As Map = CreateMap("userName": "guest@qubic.li", "password": "guest13@Qubic.li", "twoFactorCode": "")
Dim json As String = payload.As(JSON).ToString
job.PostString("https://api.qubic.li/Auth/Login", json)
job.GetRequest.SetContentType("application/json-patch+json")
Wait For (job) JobDone (job As HttpJob)
If job.Success Then
Dim response As Map = job.GetString.As(JSON).ToMap
Log(response.Get("token"))
End If
job.Release
End Sub
Sub GetToken
' Code_jOkHttpUtils2_Post_Json
Dim job As HttpJob
job.Initialize("", Me)
Dim payload As Map = CreateMap("userName": "guest@qubic.li", "password": "guest13@Qubic.li", "twoFactorCode": "")
Dim json As String = payload.As(JSON).ToString
job.PostString("https://api.qubic.li/Auth/Login", json)
job.GetRequest.SetContentType("application/json-patch+json")
Wait For (job) JobDone (job As HttpJob)
If job.Success Then
Dim response As Map = job.GetString.As(JSON).ToMap
Log(response.Get("token"))
End If
job.Release
End Sub