Re: Invalid JSON?

2019-06-03 Thread Arnaud de Montard via 4D_Tech
> Le 3 juin 2019 à 07:49, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > HI Keisuke, > > Perhaps I should know, but what is a BOM? BOM stands for byte order mark: In most text editor (BBEdit, notepad c++…) there's an

Re: Invalid JSON? - solved

2019-06-03 Thread JOHN BAUGHMAN via 4D_Tech
There is a gremlin in the response. I cannot see it in the debugger , but the leading character is not (. If I set it to the pasteboard and paste it the JSON Validator it disappears as well if I paste it into a text editor. The following fixes it… If (Substring($Response;1;1)#"{")

Re: Invalid JSON?

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
HI Keisuke, Perhaps I should know, but what is a BOM? Using a BLOB for the response variable then converting to text did not delete the BOM. It did however reveal what it was…. ø Using a BLOB has a couple of more steps the just passing a text variable. I

Re: Invalid JSON?

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
John, After posting I found that the problem was an unknown leading character which does not get copied to the pasteboard with SET TEXT TO PASTEBOARD. So the posted text would not throw an error. John > On Jun 2, 2019, at 5:03 PM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> >

Re: Invalid JSON?

2019-06-02 Thread Keisuke Miyako via 4D_Tech
perhaps there is a BOM. did you pass a C_TEXT to HTTP Request? you might want to use a BLOB, then Convert to text (which will get rid of the BOM), then parse. 2019/06/03 10:05、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com>のメール: JSON malformed in line 1,

Re: Invalid JSON?

2019-06-02 Thread John DeSoi via 4D_Tech
What version of 4D? JSON Parse on what you provided below does not throw an error with 4D 17.1. John DeSoi, Ph.D. > On Jun 2, 2019, at 8:05 PM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I am getting the following from zip-codes.com… > > { > "item": { >