I just started learning Banano and I'm wondering how to convert the following piece of B4A code to Banano PWA. It would be great if someone could kindly give me a hint or two.
TIA
TIA
b4a code:
Dim map1 As Map = CreateMap("orderid": "12345678", "customer_id": "1234")
Dim JSON As JSONGenerator
JSON.Initialize(map1)
Dim data As String = JSON.ToPrettyString(1) 'indent by 1 space
Dim J As HttpJob 'depends OKHttpUtils2
J.Initialize("J",Me)
J.PostString("https://mysite.com/getdetail.php" , data )
Wait For (j) JobDone(j As HttpJob)
If j.Success=False Then
j.Release
Log("unable to get data")
End If
Dim parser As JSONParser
parser.Initialize($"${J.GetString}"$)
j.Release 'asap
Dim lstResult As List
lstResult.Initialize
Try
lstResult=parser.NextArray
Catch
Log(LastException)
End Try
For Each m As Map In lstResult 'ignore
'go throught each record
'''''''
Next