Hi all.
I need to create this json to send it via http post
My problem is that this row return me an array access error
ahash["posta_options"]["sender"]["indirizzo"] = "Via Zama 4"
Any ideas ? This is the full code:
aHash := hash()
ahash["sender"] = "LOGIC SRL"
ahash["posta_options"] := hash()
ahash["posta_options"] := hash()["sender"] := hash()
ahash["posta_options"]["sender"]["indirizzo"] = "Via Zama 4"
ahash["posta_options"]["sender"]["cap"] = "20110"
ahash["posta_options"]["sender"]["citta"] = "Milano"
ahash["posta_options"]["sender"]["provincia"] = "MI"
ahash["posta_options"]["sender"]["nazione"] = "Italia"
cJson := hb_jsonEncode(ahash,.f.)
Problem with Json
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Problem with Json
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Problem with Json
Marco,
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL aHash := hash()
LOCAL cJson
ahash["sender"] = "LOGIC SRL"
ahash["posta_options"] := hash()
ahash["posta_options"]["sender"] := hash()
ahash["posta_options"]["sender"]["indirizzo"] = "Via Zama 4"
ahash["posta_options"]["sender"]["cap"] = "20110"
ahash["posta_options"]["sender"]["citta"] = "Milano"
ahash["posta_options"]["sender"]["provincia"] = "MI"
ahash["posta_options"]["sender"]["nazione"] = "Italia"
cJson := hb_jsonEncode(ahash,.f.)
? cJson
RETURN NIL
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: Problem with Json
It is fine. Thank you very much Enrico.
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
Re: Problem with Json
Ciao
Mai avuto a che fare con tematica INVIO DATI TESSERA SANITARIA ?
Mai avuto a che fare con tematica INVIO DATI TESSERA SANITARIA ?