Sub post_image(recipients As String , caption As String, content As String )
Dim j As HttpJob
j.Initialize("", Me)
Dim m As Map = CreateMap("caption":caption,"type":"image/png","recipients":recipients,"content":content)
Dim generator As JSONGenerator
generator.Initialize(m)
Dim ss As String = generator.ToString
ss.Replace("\","")
Log("String to send "&ss)
j.PostString("http://64.6.221.124:1744/img/listPOST",ss)
j.GetRequest.SetContentType("application/json")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Try
Dim parser As JSONParser
Log("Serial Result "&j.GetString)
parser.Initialize(j.GetString)
Dim root As Map = parser.NextObject
Dim msg_id As String = root.Get("msg_id")
Log($"update messages set id_message = '${msg_id}' ,estatus = 1, fecha_recepcion = 'now()' where telefono = '${telefono}' and mensaje = '${mensaje}'"$)
sql1.ExecNonQuery($"update messages set id_messages = '${msg_id}' ,status = 1, fecha_recepcion = now() where telefono = '${telefono}' and mensaje = '${mensaje}'"$)
Catch
Log(LastException)
End Try
End If
j.Release
Sleep(1000)
End Sub