Hi all,
I'm using Erel routine about multipartpost:
https://www.b4x.com/android/forum/threads/android-http-multipart-requests.8411/#post-47094
I just modified OkHttpResponse instead ok OkHttpResponse and okHttpRequest instead of HttpRequest
Also in MultiPartPost module
I have this error: getstring unknown member
I use B4A 7.80
android.jar is version 27
and use these libraries:
Thanks all
Marco
I'm using Erel routine about multipartpost:
https://www.b4x.com/android/forum/threads/android-http-multipart-requests.8411/#post-47094
B4X:
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
I just modified OkHttpResponse instead ok OkHttpResponse and okHttpRequest instead of HttpRequest
Also in MultiPartPost module
I have this error: getstring unknown member
I use B4A 7.80
android.jar is version 27
and use these libraries:
Thanks all
Marco