Re: JSON

2023-08-15 Thread Tore Nilsen via use-livecode
An array of object would be turned into a multidimensional array with value pairs in LiveCode. Depending on the source the main keys may be numeric or assosiative, like in these examples: contriesArray[1][name] contriesArray[1][capitol] contriesArray[1][inhabitants] Or

Re: JSON

2023-08-15 Thread Dar Scott via use-livecode
Thanks, Tore! I found these in the dictionary. For JsonImport I noted this: The return value may be any of the following types, depending on the content of the file: Array (for a JSON object) List (for a JSON array) String (for a JSON string) Number (for any JSON number) Boolean (for JSON true

Re: JSON

2023-08-14 Thread Richmond Mathewson via use-livecode
This has recently been explored across on the forums where I managed to expose my full level of ignorance on the subject. Best, Richmond. On Tue, 15 Aug 2023, 07:59 Tore Nilsen via use-livecode, < use-livecode@lists.runrev.com> wrote: > JsonImport will make an array of your JSON data, whereas

Re: JSON

2023-08-14 Thread Tore Nilsen via use-livecode
JsonImport will make an array of your JSON data, whereas JsonExport will turn your array into JSON data. Not much fiddling there. Best regards Tore Nilsen > 15. aug. 2023 kl. 02:07 skrev Dar Scott via use-livecode > : > > > I’m about write some scripts that fiddle with JSON. I have some old

Re: JSON to Datagrid

2021-12-08 Thread Tom Glod via use-livecode
JSONToArray works well for me if your JSON is correct. Always use try when decoding from JSON to catch any errors. On Wed, Dec 8, 2021 at 12:58 PM Mike Kerner via use-livecode < use-livecode@lists.runrev.com> wrote: > completely off the top of my head, so this might not be quite right >

Re: JSON to Datagrid

2021-12-08 Thread Mike Kerner via use-livecode
completely off the top of my head, so this might not be quite right jsonToArray set the dgData of group "datagrid 1" to On Wed, Dec 8, 2021 at 11:39 AM Keith Clarke via use-livecode < use-livecode@lists.runrev.com> wrote: > Hi Skip, > I don’t use Datagrids but have used a two-step process to

Re: JSON to Datagrid

2021-12-08 Thread Keith Clarke via use-livecode
Hi Skip, I don’t use Datagrids but have used a two-step process to get JSON into the Tree widget and a similar process may provide a direction of travel to test…? 1. JSON-to-array https://lessons.livecode.com/m/4071/l/1303394-how-to-read-in-data-from-a-json-file 2. Setting the array data of

Re: JSON to Datagrid

2021-12-08 Thread Skip Kimpel via use-livecode
To functions actually needed... need to be able to convert to a datagrid and I will be also pumping this data into a SQL server. SKIP On Wed, Dec 8, 2021 at 11:15 AM Skip Kimpel wrote: > I have been googling a solution for this but have not found a solid > solution for this. > > Can anybody

Re: JSON import error

2017-11-03 Thread Dave Kilroy via use-livecode
quite agree, and as Jacque says “its the law” - and only the brave own up to their DOH! moments (of which I have several every hour) kind regards dave > From the thrid party perspective, it doesn’t matter whether the OP has an > epiphany, or another list contributor solves the problem. All

Re: JSON import error

2017-11-03 Thread Mark Wieder via use-livecode
On 11/03/2017 05:03 AM, Phil Jimmieson via use-livecode wrote: Or when you’re preparing an example stack for the bug report and realise that it’s not a bug, you’ve been doing it wrong... Normally I find that right *after* filing the bug report. -- Mark Wieder ahsoftw...@gmail.com

Re: JSON import error

2017-11-03 Thread Mark Waddingham via use-livecode
On 2017-11-03 13:03, Phil Jimmieson via use-livecode wrote: Or when you’re preparing an example stack for the bug report and realise that it’s not a bug, you’ve been doing it wrong... Recipe stacks for bugs are useful for all kinds of reasons ;) Warmest Regards, Mark. -- Mark Waddingham ~

Re: JSON import error

2017-11-03 Thread Phil Jimmieson via use-livecode
Or when you’re preparing an example stack for the bug report and realise that it’s not a bug, you’ve been doing it wrong... > On 3 Nov 2017, at 11:55, Mark Waddingham via use-livecode > wrote: > > On 2017-11-02 19:57, J. Landman Gay via use-livecode wrote: >> On

Re: JSON import error

2017-11-03 Thread Mark Waddingham via use-livecode
On 2017-11-02 19:57, J. Landman Gay via use-livecode wrote: On 11/2/17 6:52 AM, Dave Kilroy via use-livecode wrote: https://en.wikipedia.org/wiki/Rubber_duck_debugging Yeah. Story of my life. I've since hit another error in the JSON import

Re: JSON import error

2017-11-03 Thread David V Glasgow via use-livecode
From the thrid party perspective, it doesn’t matter whether the OP has an epiphany, or another list contributor solves the problem. All is good interesting and helpful. It’s also nice to see that even the wise ones have the same 'moments of discovery' that the rest of us do. David G > On

Re: JSON import error

2017-11-02 Thread J. Landman Gay via use-livecode
On 11/2/17 2:45 PM, Mark Wieder via use-livecode wrote: On 11/02/2017 11:57 AM, J. Landman Gay via use-livecode wrote: On 11/2/17 6:52 AM, Dave Kilroy via use-livecode wrote: https://en.wikipedia.org/wiki/Rubber_duck_debugging Yeah. Story

Re: JSON import error

2017-11-02 Thread Mark Wieder via use-livecode
On 11/02/2017 11:57 AM, J. Landman Gay via use-livecode wrote: On 11/2/17 6:52 AM, Dave Kilroy via use-livecode wrote: https://en.wikipedia.org/wiki/Rubber_duck_debugging Yeah. Story of my life. I've since hit another error in the JSON

Re: JSON import error

2017-11-02 Thread J. Landman Gay via use-livecode
On 11/2/17 6:52 AM, Dave Kilroy via use-livecode wrote: https://en.wikipedia.org/wiki/Rubber_duck_debugging Yeah. Story of my life. I've since hit another error in the JSON import but now I'm afraid to post about it. :) -- Jacqueline

Re: JSON import error

2017-11-02 Thread Dave Kilroy via use-livecode
https://en.wikipedia.org/wiki/Rubber_duck_debugging ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription

Re: JSON import error

2017-11-02 Thread Monte Goulding via use-livecode
file: will recognise the BOM and decode the text correctly. > On 2 Nov 2017, at 5:36 pm, J. Landman Gay via use-livecode > wrote: > > I sent my message too soon. If I import as "file:" instead of "binfile:" it > mostly works. > > You always figure it out as

Re: JSON import error

2017-11-02 Thread J. Landman Gay via use-livecode
I sent my message too soon. If I import as "file:" instead of "binfile:" it mostly works. You always figure it out as soon as you post. It's a rule. On 11/2/17 1:02 AM, J. Landman Gay via use-livecode wrote: I am trying to convert some JSON to a LC array. Both JSONImport and JSONToArray are

Re: JSON library on LC Server

2017-03-09 Thread Devin Asay via use-livecode
On Mar 9, 2017, at 10:31 AM, Devin Asay via use-livecode > wrote: Can anyone tell me how/if one can use the JSON library from LC 8 on LC Server? I’m running Community Server v. 8.1.2 on a Linux server. I tried just calling

Re: JSON commands are not in the dictionary

2016-07-14 Thread Sannyasin Brahmanathaswami
gt; Date: Thursday, July 14, 2016 at 6:21 PM To: How LiveCode <use-livecode@lists.runrev.com> Subject: Re: JSON commands are not in the dictionary Go to the Œsection¹ menu in the top left corner of the dictionary window and select 'JSON Library¹. Terry...

Re: JSON commands are not in the dictionary

2016-07-14 Thread Terry Judd
Go to the Œsection¹ menu in the top left corner of the dictionary window and select 'JSON Library¹. Terry... On 15/07/2016 2:05 pm, "use-livecode on behalf of Sannyasin Brahmanathaswami" wrote: >I can't find the new JSON

Re: JSON not working in Standalones?

2016-06-20 Thread Ali Lloyd
> in 8.1.0 (dp 1) the new “Inclusions”-tab in the standalone settings is disabled, > so I can’t select anything there. I suspect you may have the "search for inclusions" radio button selected instead of the "select inclusions" one, in the General tab. On Mon, Jun 20, 2016 at 1:44 PM Ton Kuypers

Re: JSON not working in Standalones?

2016-06-20 Thread Ton Kuypers
Yes, that part I already figured out ;-) But is there a way to add the JSON-part or all of the mergExt to a standalone right now? Met vriendelijke groeten, Warm Regards, Ton Kuypers +32 (0) 477 739 530 Steenweg op Leopoldsburg 100 • B-2490 • Balen • Belgium www.publishingtools4u.com >

Re: JSON not working in Standalones?

2016-06-18 Thread Monte Goulding
In 8.1.0 the mergExt externals are not yet being searched for so you need to manually select inclusions. Ali is working on a mechanism to allow searching for them. Cheers Monte Sent from my iPhone > On 19 Jun 2016, at 4:19 AM, tkuyp...@telenet.be > wrote: >

Re: JSON library

2015-11-18 Thread Peter Haworth
Thanks Ali, that fixed it. I'ma little surprised I didn't get a runtime error in the standalone though - shouldn't it have choked on the jsonImport command? Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin

Re: JSON library

2015-11-18 Thread Peter TB Brett
On 18/11/2015 11:02, Lyn Teyla wrote: Ali Lloyd wrote: The JSON library is an extension and so you need to include it manually (at least at the moment) - you'll need to select com.livecode.library.json in the Copy Files pane of the standalone settings. On a somewhat related note, how does

Re: JSON library

2015-11-18 Thread Lyn Teyla
Ali Lloyd wrote: > The JSON library is an extension and so you need to include it manually (at > least at the moment) - you'll need to select com.livecode.library.json in > the Copy Files pane of the standalone settings. On a somewhat related note, how does one utilize this JSON library (and

Re: JSON library

2015-11-18 Thread Ali Lloyd
Hi Peter, The JSON library is an extension and so you need to include it manually (at least at the moment) - you'll need to select com.livecode.library.json in the Copy Files pane of the standalone settings. On Tue, Nov 17, 2015 at 10:55 PM Peter Haworth wrote: > A stack that

Re: JSON, URL-encode, and UTF-8

2015-08-21 Thread J. Landman Gay
On 8/21/2015 3:06 AM, Dave Cragg wrote: Instead of removing the httpHeaders setting, what if you set it to this? set the httpHeaders to Content-Type: application/x-www-form-urlencoded This is normally the default for post, but if you had set it to something else earlier, I was wondering

Re: JSON, URL-encode, and UTF-8

2015-08-21 Thread Peter W A Wood
On 21 Aug 2015, at 10:59, Peter W A Wood peterwaw...@gmail.com wrote: Jacque On 21 Aug 2015, at 10:13, J. Landman Gay jac...@hyperactivesw.com mailto:jac...@hyperactivesw.com wrote: Here's a test. This posts just fine in LC 6.x but fails in 7.0.6 and 7.1rc1. Make a field with this

Re: JSON, URL-encode, and UTF-8

2015-08-21 Thread Dave Cragg
On 21 Aug 2015, at 02:27, J. Landman Gay jac...@hyperactivesw.com wrote: On 8/20/2015 6:45 PM, Dave Cragg wrote: What happens if you remove the httpHeader setting and also UrlEncode tData? Still errors I'm afraid. Instead of removing the httpHeaders setting, what if you set it to this?

Re: JSON, URL-encode, and UTF-8

2015-08-21 Thread Charles Warwick
HI Peter, I did some testing with Jacque and found that her LC7 was sending the wrong content-type when posting to the PHP script. In case anyone is interested: It was using a content type of 'application/json’ which would have made sense if the PHP script was written to accept the json data

Re: JSON, URL-encode, and UTF-8

2015-08-21 Thread Peter W A Wood
Hi Charles On 21 Aug 2015, at 16:07, Charles Warwick char...@techstrategies.com.au wrote: HI Peter, I did some testing with Jacque and found that her LC7 was sending the wrong content-type when posting to the PHP script. In case anyone is interested: It was using a content type

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Charles Warwick
That script works here with HTTPS, I am guessing there is something else specific about the configuration. On 21 Aug 2015, at 1:23 pm, Peter W A Wood peterwaw...@gmail.com wrote: Jacque This works fine in LiveCode 7.0.3. I’ll download 7.1RC1 and see if it works there too. Apart

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
Now I don't know what to try next. :( But I appreciate your help. This is a weird one. Is your PHP script like the one Peter posted? On 8/20/2015 10:30 PM, Charles Warwick wrote: That script works here with HTTPS, I am guessing there is something else specific about the configuration. On

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
On 8/20/2015 10:23 PM, Peter W A Wood wrote: Jacque This works fine in LiveCode 7.0.3. I’ll download 7.1RC1 and see if it works there too. Apart from the difference in LiveCode versions, there is one other difference that may be significant. I am using HTTP on my machine not HTTPS. There

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Peter W A Wood
Jacque On 21 Aug 2015, at 11:32, J. Landman Gay jac...@hyperactivesw.com wrote: I'd thought of that too. I'll ask the PHP guy to set up an http URL. I don’t think it is a problem with HTTPS. With Google and Stack overflow’s help, I found this website - http://httpbin.org - you can send a

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Peter W A Wood
Jacque This works fine in LiveCode 7.0.3. I’ll download 7.1RC1 and see if it works there too. Apart from the difference in LiveCode versions, there is one other difference that may be significant. I am using HTTP on my machine not HTTPS. There have been some bugs in LiveCode 7 HTTPS

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Monte Goulding
On 21 Aug 2015, at 10:58 am, Peter W A Wood peterwaw...@gmail.com wrote: put textEncode({ quote é quote : 1}, UTF-8) into tJSON put json= before tJSON post URLEncode(tJSON) to URL http://Localhost/jacque.php http://localhost/jacque.php put textDecode(it, UTF-8”) You would want to

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Monte Goulding
Just before posting can you dump your tData variable into a binfile and send it to me. It's got to be something simple... Sent from my iPhone On 21 Aug 2015, at 8:33 am, J. Landman Gay jac...@hyperactivesw.com wrote: Thanks, but still no go. I get the same errors. Is anyone posting from

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Monte Goulding
On 21 Aug 2015, at 9:25 am, Peter W A Wood peterwaw...@gmail.com wrote: You’re content is no longer valid JSON once you have inserted the “json=“ (at the PHP developer’s request). There may be a conflict between the header and the actual content. What happens if you remove the line

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
On 8/20/2015 6:25 PM, Peter W A Wood wrote: You’re content is no longer valid JSON once you have inserted the “json=“ (at the PHP developer’s request). There may be a conflict between the header and the actual content. What happens if you remove the line setting the httpHeaders? Thanks Peter.

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Monte Goulding
On 21 Aug 2015, at 9:29 am, Monte Goulding mo...@sweattechnologies.com wrote: That’s a good question. I can’t see anything wrong with the JSON itself after reviewing the file. Validates and formats fine in TextMate. Are you sure they want post and not get or put? Hmm… I just remembered

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Charles Warwick
It will still be useful… what I want to look at is what headers are generated and whether or not the JSON is still correctly formatted. With a copy of the script, I should be able to tell you what is causing it to break between the versions. I have been posting JSON data to PHP in other

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Monte Goulding
What happens if you comment out line 247 of revLibURL stack script? textEncode native here seems to be a rather dangerous thing to do… On 21 Aug 2015, at 9:45 am, Dave Cragg dcr...@lacscentre.co.uk wrote: On 21 Aug 2015, at 00:33, J. Landman Gay jac...@hyperactivesw.com wrote: On

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Charles Warwick
Encoding the = would break the POST data, as it would no longer be assigned the json data itself as a POST variable…. you only want to url encode the contents of the json variable On 21 Aug 2015, at 11:17 am, Monte Goulding mo...@sweattechnologies.com wrote: On 21 Aug 2015, at 10:58 am,

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
On 8/20/2015 8:46 PM, Charles Warwick wrote: It will still be useful… what I want to look at is what headers are generated and whether or not the JSON is still correctly formatted. With a copy of the script, I should be able to tell you what is causing it to break between the versions. I have

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Peter W A Wood
Jacque On 21 Aug 2015, at 10:13, J. Landman Gay jac...@hyperactivesw.com wrote: Here's a test. This posts just fine in LC 6.x but fails in 7.0.6 and 7.1rc1. Make a field with this in it: [{Meals:Yes,Purpose:Business}] Now put this into a button or card script: constant

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Charles Warwick
If you are still having issues with this, I am happy to run a packet capture against it if you give me a copy of the script… That way I can tell you what the exact difference is between what LC7 and LC6 actually post to the server… On 21 Aug 2015, at 9:50 am, Monte Goulding

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
On 8/20/2015 6:45 PM, Dave Cragg wrote: What happens if you remove the httpHeader setting and also UrlEncode tData? Still errors I'm afraid. Monte wrote: What happens if you comment out line 247 of revLibURL stack script? textEncode native here seems to be a rather dangerous thing to do…

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
On 8/20/2015 7:24 PM, Charles Warwick wrote: If you are still having issues with this, I am happy to run a packet capture against it if you give me a copy of the script… That way I can tell you what the exact difference is between what LC7 and LC6 actually post to the server… Actually, now

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Charles Warwick
If I send that to a PHP script on one of my servers, I receive the JSON data correctly from LC7 in the PHP script. I will just run it against LC6 and make sure it is identical. If you want, you can post to my PHP script and then we can see how it compares between the two versions. If it works

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Peter W A Wood
Jacque On 21 Aug 2015, at 05:53, J. Landman Gay jac...@hyperactivesw.com wrote: Here's what I do: set the httpHeaders to content-type: application/json put convertToJSON() into tData -- produces valid JSON put json= before tData post tData to kServerURL You’re content is no longer

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Dave Cragg
On 21 Aug 2015, at 00:33, J. Landman Gay jac...@hyperactivesw.com wrote: On 8/20/2015 6:25 PM, Peter W A Wood wrote: You’re content is no longer valid JSON once you have inserted the “json=“ (at the PHP developer’s request). There may be a conflict between the header and the actual

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Peter W A Wood
Jacque On 21 Aug 2015, at 07:35, J. Landman Gay jac...@hyperactivesw.com wrote: Right. Works without header in 6, fails in 7. Thanks for looking at my file. I wonder what would happen if I use the LC 6 libURL script in LC 7. Will my unicode go all wonky? The file I sent you is in English

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
On 8/20/2015 6:32 PM, Monte Goulding wrote: On 21 Aug 2015, at 9:29 am, Monte Goulding mo...@sweattechnologies.com wrote: That’s a good question. I can’t see anything wrong with the JSON itself after reviewing the file. Validates and formats fine in TextMate. Are you sure they want post and

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
Here's a test. This posts just fine in LC 6.x but fails in 7.0.6 and 7.1rc1. Make a field with this in it: [{Meals:Yes,Purpose:Business}] Now put this into a button or card script: constant kServerURL = https://www.domain.com/results.php; --### use a valid URL here command

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
I'm still struggling with this. I have a valid JSON string, verified by a web-checking site and by the PHP developer. He wants me to POST it this way: json=JSON string It doesn't work. He says the server receives it but it is not passed to the PHP script because the main parameter is empty.

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread Monte Goulding
Is your convertToJSON function returning UTF8? I’m not sure what LC 7 does when it concatenates “json=“ to a UTF8 string. If for example that json= is UTF16 and the rest of the data is UTF8 it’s not surprising the server is freaking out. Try: put textEncode(“json=“,”UTF8”) before tData On 21

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
Okay, addendum: It works fine in LC 6.7.6. It fails entirely in 7.0.6. I wish I'd tried that sooner. We need 7.x because of the unicode support. On 8/20/2015 4:53 PM, J. Landman Gay wrote: I'm still struggling with this. I have a valid JSON string, verified by a web-checking site and by the

Re: JSON, URL-encode, and UTF-8

2015-08-20 Thread J. Landman Gay
Thanks, but still no go. I get the same errors. Is anyone posting from LC 7? I also just tried 7.1rc1 but it doesn't work either. On 8/20/2015 5:04 PM, Monte Goulding wrote: Is your convertToJSON function returning UTF8? I’m not sure what LC 7 does when it concatenates “json=“ to a UTF8

Re: JSON, URL-encode, and UTF-8

2015-08-17 Thread Monte Goulding
On 18 Aug 2015, at 6:54 am, J. Landman Gay jac...@hyperactivesw.com wrote: Thanks Monte. The JSON is created by EasyJSON from a LC array. Most of the values in the array are in foreign languages with lots of non-ascii characters, and those will become the values in the parameter string

Re: JSON, URL-encode, and UTF-8

2015-08-17 Thread Monte Goulding
I think we would need to see the API to know about the urlEncoding. Is it a parameter in your query string? If you need to urlEncode it will be the last thing you do. If you are using one of the script libraries the UTF8 encoding may be done for you. If you are using mergJSON then UTF8 encode

Re: JSON, URL-encode, and UTF-8

2015-08-17 Thread J. Landman Gay
Thanks Monte. The JSON is created by EasyJSON from a LC array. Most of the values in the array are in foreign languages with lots of non-ascii characters, and those will become the values in the parameter string that I will send in a POST. It doesn't look like EasyJSON does any UTF8 encoding

Re: JSON Safe Text

2015-07-24 Thread David Bovill
Yes - it's taken from the wild (an HTML page on the internet). Then turned into XML, then a table extracted etc - so looks to me like non-utf8 stuff has go in there somewhere. That's why I was wandering if there was a way to filter out arbitrary text and make it utf8-safe. You know urlencode for

Re: JSON Safe Text

2015-07-24 Thread Monte Goulding
You really need to know the encoding you are working with. Check if the page has a charset attribute first and if it does re-encode to utf8 first. The try it in mergJSON. If it chokes then the best you can do is replace any char greater than charToNum(127) with “?”. Other than that I think

Re: JSON Safe Text

2015-07-23 Thread Monte Goulding
On 24 Jul 2015, at 7:22 am, David Bovill david@viral.academy wrote: I'm placing the text into an array and then using Monte's mergJsonEncode function to decode it. Usually works fine - but in this case it looks like the content needs some tidying before I put it into the array. mergJSON

Re: JSON parser discovery

2015-07-21 Thread Jim Lambert
MarkW wrote: json_pp filename Mark, Very handy. Fast too. Thanks! Jim Lambert ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

Re: JSON

2013-06-05 Thread Igor de Oliveira Couto
Sorry to come so late to this thread. It's nice to see that my little JSON library is being used. I wanted to let everyone know, that Monte's library is much faster and more efficient than the LiveCode-native solutions, like mine. I wholeheartedly recommend it. There are occasions, however,

Re: JSON

2013-06-04 Thread Richard Gaskin
Mark Wieder wrote: Well, what you want to push to the server depends on the key:value pairs they expect. Here's a simple example: {name : Tom McGrath, favorite_author : Dr. Seuss} Here's an example from a mongodb student database: {_id: {oid : 1234}, student_id : 0, class_id : 49,

Re: JSON

2013-06-04 Thread Thomas McGrath III
Monte, Are you saying that array's are not supported on iOS or are you saying that mergJSON is not supported on iOS? This is needed from an iOS app to send the data to my server from the app. Tom -- Tom McGrath III http://lazyriver.on-rev.com mcgra...@mac.com On Jun 3, 2013, at 10:32 PM,

Re: JSON

2013-06-04 Thread Andrew Kluthe
mergJSON i do believe. arrays not being supported on iOS would come as kind of a shock to me. On Tue, Jun 4, 2013 at 4:17 PM, Thomas McGrath III mcgra...@mac.com wrote: Monte, Are you saying that array's are not supported on iOS or are you saying that mergJSON is not supported on iOS? This is

Re: JSON

2013-06-04 Thread J. Landman Gay
On 6/4/13 4:17 PM, Thomas McGrath III wrote: Monte, Are you saying that array's are not supported on iOS or are you saying that mergJSON is not supported on iOS? This is needed from an iOS app to send the data to my server from the app. If Monte's external doesn't work out, there are several

Re: JSON

2013-06-04 Thread Monte Goulding
On 05/06/2013, at 7:17 AM, Thomas McGrath III mcgra...@mac.com wrote: Monte, Are you saying that array's are not supported on iOS or are you saying that mergJSON is not supported on iOS? This is needed from an iOS app to send the data to my server from the app. Arrays are not yet supported

Re: JSON

2013-06-04 Thread Thomas McGrath III
Thanks for the info. I am trying to use Igor's library and I am trying to build my first array to convert to json. This is the info I have to send as json: {data: {appuser_details: { name:Tom_iPad, email:i...@gmail.com, device_type:2, dentist_id:73,

Re: JSON

2013-06-04 Thread Monte Goulding
Are device_type and dentist_id meant to be strings or integers? On 05/06/2013, at 7:55 AM, Thomas McGrath III mcgra...@mac.com wrote: Thanks for the info. I am trying to use Igor's library and I am trying to build my first array to convert to json. This is the info I have to send as json:

Re: JSON

2013-06-04 Thread Thomas McGrath III
I don't know Monte, I will try and find out. But the info below is what was sent in the test using a restful client by the developer of the api. -- Tom McGrath III http://lazyriver.on-rev.com mcgra...@mac.com On Jun 4, 2013, at 6:07 PM, Monte Goulding mo...@sweattechnologies.com wrote: Are

Re: JSON

2013-06-04 Thread J. Landman Gay
On 6/4/13 4:55 PM, Thomas McGrath III wrote: Thanks for the info. I am trying to use Igor's library and I am trying to build my first array to convert to json. This is the info I have to send as json: {data: {appuser_details: { name:Tom_iPad, email:i...@gmail.com, device_type:2, dentist_id:73,

Re: JSON

2013-06-04 Thread Monte Goulding
On 05/06/2013, at 8:16 AM, Thomas McGrath III wrote: I don't know Monte, I will try and find out. But the info below is what was sent in the test using a restful client by the developer of the api. strings then -- M E R Goulding Software development services Bespoke application development

Re: JSON

2013-06-04 Thread Monte Goulding
On 05/06/2013, at 8:57 AM, J. Landman Gay wrote: I got the same error at first. The web server can't understand what you're sending. You just need to create a regular LiveCode array (none of that punctuation stuff,) pass it through Igor's library, and then send a POST with whatever you

Re: JSON

2013-06-04 Thread Andrew Kluthe
I dont know about the libraries he is using, but if it is based at all on the late mark smiths's the numbers in his array would translate to integers in terms of the json it spits out. I actually had to modify the output of the mark smith library to place 0's before decimal points to avoid bad

Re: JSON

2013-06-04 Thread Monte Goulding
On 05/06/2013, at 9:40 AM, Andrew Kluthe wrote: Hmm, I wonder why your back end developer would be looking to use strings in the place of integers Well... they look like numbers in the sample data we have but they might not always be numbers. It's risky just assuming if an element is a

Re: JSON

2013-06-04 Thread Andrew Kluthe
Good point. Handy feature. I might have to see if that can replace my modified mark smith lib in some of my projects. Is mergJSON dual licensed? On Tue, Jun 4, 2013 at 6:58 PM, Monte Goulding mo...@sweattechnologies.comwrote: On 05/06/2013, at 9:40 AM, Andrew Kluthe wrote: Hmm, I wonder

Re: JSON

2013-06-04 Thread Monte Goulding
On 05/06/2013, at 11:08 AM, Andrew Kluthe wrote: Good point. Handy feature. I might have to see if that can replace my modified mark smith lib in some of my projects. Is mergJSON dual licensed? That's the intention but as there hasn't been a rush to buy (I did expect that given there's LC

Re: JSON

2013-06-04 Thread Thomas McGrath III
Andrew, That did it. I had the headers wrong. set the httpHeaders to Content-Type: application/json worked and not set the httpHeaders to text/json did not. It actually worked. THanks to everyone who helped me out. Tom -- Tom McGrath III http://lazyriver.on-rev.com mcgra...@mac.com On Jun

Re: JSON

2013-06-04 Thread Andrew Kluthe
Nice. glad to hear that! On Tue, Jun 4, 2013 at 8:33 PM, Thomas McGrath III mcgra...@mac.com wrote: Andrew, That did it. I had the headers wrong. set the httpHeaders to Content-Type: application/json worked and not set the httpHeaders to text/json did not. It actually worked. THanks to

Re: JSON

2013-06-03 Thread Mark Schonewille
Hi Tom, If you don't need to send any binary data (that includes unicode text) then you have no need for JSON (or XML for that matter). You'll need to make sure that everybody understands what type of data you're going to use, though, and what the record and item delimiters are. -- Best

Re: JSON

2013-06-03 Thread Thomas McGrath III
Thanks Mark, That's just the kind of advice I was looking for. Tom -- Tom McGrath III http://lazyriver.on-rev.com mcgra...@mac.com On Jun 3, 2013, at 4:54 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: Hi Tom, If you don't need to send any binary data (that includes unicode

Re: JSON

2013-06-03 Thread Mark Wieder
Thomas McGrath III mcgrath3@... writes: have is Is it better to go the JSON route from within a Livecode Mobile app or should I go for the easy way out Is this a trick question? The easy way out is *always* better g. Do you have a lot of data to push? Any binary data? Do you need to receive

Re: JSON

2013-06-03 Thread Thomas McGrath III
Mark, The data is very simple with no binary at all. I won't need to receive any back. So… -- Tom McGrath III http://lazyriver.on-rev.com mcgra...@mac.com On Jun 3, 2013, at 6:20 PM, Mark Wieder mwie...@ahsoftware.net wrote: Thomas McGrath III mcgrath3@... writes: have is Is it better to

Re: JSON

2013-06-03 Thread Monte Goulding
On 04/06/2013, at 12:14 PM, Thomas McGrath III wrote: The data is very simple with no binary at all. I won't need to receive any back. So… Tom... JSON is no more complicated to write or difficult to read than a query string... If you are comfortable with one or the other then use that...

Re: JSON

2013-06-03 Thread Mark Wieder
Tom- Monday, June 3, 2013, 7:14:37 PM, you wrote: Mark, The data is very simple with no binary at all. I won't need to receive any back. So… Well, what you want to push to the server depends on the key:value pairs they expect. Here's a simple example: {name : Tom McGrath, favorite_author

Re: JSON

2013-05-28 Thread Mark Wieder
What Andrew said. I do the same using post, and it's pretty painless and the key-value pairs are more readable than xml if you can handle all the braces. -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list

Re: JSON

2013-05-23 Thread Richard Gaskin
Thomas McGrath III wrote: I have a server project where I need to send some JSON to a URL. I've never done this before. Has anyone got a simple example/explanation of how this is achieved? I had to do that for a project recently, and I just sent the JSON to the server as the data in a POST

Re: JSON

2013-05-23 Thread Monte Goulding
Take a look at JSON.org for the file format. I have a desktop/server external that does ArrayToJSON and visa versa if that helps. It's utf8 only. It's currently GPL licensed and I intend to do a commercial license when someone wants one ;-) -- M E R Goulding Software development services

Re: JSON

2013-05-23 Thread Andrew Kluthe
I do this a lot in my work. Generally it is up to how the server wants to receive the JSON. There are several ways to do it depending on the verb the server side is looking for. Is this for some kind of public API or do you have any information on the API you are trying to work with? Usually I

Re: JSON

2013-05-23 Thread J. Landman Gay
I'm working with a web person who wanted me to communicate recently using JSON (and I asked on the list about it like you did.) After looking at a couple of available libraries I thought the format was awkward and unnecessary for what we needed to do. I asked if they could just send and

Re: JSON

2012-08-29 Thread Andrew Henshaw
There is a stack on RevOnline that might help, I use it in an app and it works fine for my needs. http://revonline2.runrev.com/stack/82/LibJson-1-0b Andy On 29 Aug 2012, at 13:16, Rod McCall rodmccall...@googlemail.com wrote: Dear All, I am currently developing a server application for a

  1   2   >