Dim jsonString As String
Dim returnValue As Boolean
Try
API.Path = "/xxxx/xxxx"
Libraries.APIConnection.Initialize("Job", Me)
Libraries.APIConnection.PostMultipart(API.URL & API.Path, CreateMap("something":EditText1.Text, "something":EditText2.Text, _
"someversion":Application.VersionName),Null)
Wait For (Libraries.APIConnection) JobDone (j As HttpJob)
If j.Success Then
Dim parser As JSONParser
jsonString = j.GetString
parser.Initialize(jsonString)
Dim root As Map = parser.NextObject
Dim message As String = root.Get("message")
Dim status As Int = root.Get("status")
Select Case status
Case 0
'can't put the code here, i deleted it
Case 400
MsgboxAsync(message, "Error")
Wait For Msgbox_Result
returnValue = False
Case 422
MsgboxAsync(message, "Error")
Wait For Msgbox_Result
returnValue = False
Case Else
MsgboxAsync(message, "Error")
Wait For Msgbox_Result
returnValue = False
End Select
Else
MsgboxAsync(LastException,"")
Wait For Msgbox_Result
Log(LastException)
End If
Catch
'Log(LastException)
MsgboxAsync(LastException, "Error")
Wait For Msgbox_Result
End Try
Return returnValue