Sub Button1_Click
Dim url As String = "https://webapide.aliasgrouplab.it/api/DocumentoAttivo/100012"
Dim apiKey As String = "ce8ac27ca1c73f5afd1d2f66976aa6be88335fe6e282a921acc963d575163b6e"
Dim apiSecret As String = "e290984a3d0d8ae286306dc152b5493c70b637ffcc48f2049ba90cab73f3e26c337fa2fc97379ce9b52586b98ae92c3934bf261731d095a949a47fbb2853f58b"
Dim codiceCliente As String = "01854690433"
Dim hc As OkHttpClient
hc.InitializeAcceptAll("hc")
Dim req As OkHttpRequest
req.InitializeGet(url)
req.SetHeader("APIKey",apiKey)
req.SetHeader("APISecret",apiSecret)
req.SetHeader("CodiceCliente",codiceCliente)
hc.Execute(req,1000)
End Sub
Sub hc_ResponseSuccess (Response As OkHttpResponse, TaskId As Int)
out.InitializeToBytesArray(0)
Response.GetAsynchronously("res", out, False, TaskId)
End Sub
Sub res_StreamFinish (Success As Boolean, TaskId As Int)
Log($" ${Success}"$)
If Success Then Log(BytesToString(out.ToBytesArray, 0, out.ToBytesArray.Length, "utf8"))
End Sub
Sub hc_ResponseError (Response As OkHttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Log($"Error: ${Response.ErrorResponse}, ${Reason}, ${StatusCode}"$)
If Response <> Null Then Response.Release
End Sub