Public Sub TestAPIGetURL
Dim BaseURL As String = "http://xxxx.xxxx.xxxx.xxxx:53/API/FH/W0082"
Dim refee As String="WPCD"
Dim FECHAI As String="2021-09-01"
Dim horai As String="11:00"
Dim a As String="3"
Dim n As String="2"
Dim pa As String="1200"
Dim pn As String="0600"
Dim Parameters() As String = Array As String("refee", refee, "fechai", FECHAI, "horai", horai, "a", a, "n", n, "pa", pa, "pn", pn)
Wait For (APIGetURL(BaseURL, Parameters)) Complete (DataResult As String)
If DataResult = "" Then Return
Dim Data As Map = DataResult.As(JSON).ToMap 'ignore
Log(Data)
End Sub
Public Sub APIGetURL(URL As String, Parameters() As String) As ResumableSub
Dim ResultURL As String
Dim j As HttpJob
Try
j.Initialize("", Me)
j.Download2(URL, Parameters)
j.GetRequest.SetHeader("Content-Type","application/json")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
ResultURL = j.GetString
End If
Catch
Log(LastException.Message)
End Try
j.Release
Return ResultURL
End Sub