Sub Process_Globals
Dim hc As OkHttpClient
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
hc.Initialize("hc")
End If
......
......
End Sub
Sub pgcertificatoBTInvia_Click
'Add files
Dim files As List
files.Initialize
Dim FD As FileData
FD.Initialize
FD.Dir = File.DirDefaultExternal
FD.FileName = nomefilecertificato
FD.KeyName = "upfilecert"
FD.ContentType = "application/octet-stream"
files.Add(FD)
'Add name / values pairs (parameters)
Dim NV As Map
NV.Initialize
NV.Put("matricola", Main.WFAtletaId)
NV.Put("id_associazione ", Main.WFStrutturacod)
NV.Put("nomefile", nomefilecertificato)
Dim req As HttpRequest
req = MultipartPost.CreatePostRequest("http://www.example.com/1.php", NV, files)
hc.Execute(req, 1)
Else
messaggio=ML.ML_pgcertificato_msgbox_scegli
Msgbox2(messaggio, "webfitness","OK","","", LoadBitmap(File.DirAssets, "wflogo.png"))
End If
end sub
Sub hc_ResponseError (Response As OkHttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Log("error: " & Response & " " & StatusCode)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
End Sub
Sub hc_ResponseSuccess (Response As okHttpResponse, TaskId As Int)
Msgbox(Response.GetString("UTF8"), "")
Response.Release
End Sub