However, when I request the following test api: https://http2.pro/api/v1 I get the result, that HTTP/2 is not supported. So my question now, does the latest B4J OkHttp library really support HTTP/2?
You'll have to use http source class modules ("HttpJob.bas" "HttpUtils2Service.bas") not the jokhttputils library () and in the "HttpUtils2Service.bas" change the hc initialization to
hc.InitializeAcceptAll skips the certificate verification step
With that, this is the result:
B4X:
Dim H As HttpJob
H.Initialize("",Me)
H.Download("https://http2.pro/api/v1")
Wait For (H) JobDone(J As HttpJob)
If J.Success Then
Log(J.GetString)
Else
Log(J.ErrorMessage)
End If
I just configured my b4j (V7.0) to use the open java 11. and tried the code above
B4X:
Dim H As HttpJob
H.Initialize("",Me)
H.Download("https://http2.pro/api/v1")
Wait For (H) JobDone(J As HttpJob)
If J.Success Then
Log(J.GetString)
Else
Log(J.ErrorMessage)
End If