(foxpro, json) Obtener json desde una dirección web
Local cConecctionString
If Isnull(This.ojsonmanager) Or Vartype(This.ojsonmanager)<>"O"
This.ojsonmanager = Createobject("cjsonManager")
If Isnull(This.ojsonmanager)
Wait Window "error al crear el objeto"
cHash = ""
Return .F.
Endif
Endif
cConecctionString = "http://postu.unsa.edu.pe/iposgrado/test.php?cadena1=" + Left(cSufijourl, 20)
Local cresponse, obj
cresponse = This.ojsonmanager.jsonfromurl(cConecctionString)
If Not Empty(This.ojsonmanager.cerror)
Wait Window (This.ojsonmanager.cerror) Timeout 3
Return .F.
Else
cHash = ""
Endif
cHash = cresponse
obj = this.ojsonmanager.json2object(cresponse) &&obj puede contener la respuesta del servidor
Return .T.