JSON
Monte Goulding
monte at sweattechnologies.com
Tue Jun 4 19:13:43 EDT 2013
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 get back. I'm not sure about the headers, I don't think I had to change those but it might depend on the server.
>
> Something like this off the top of my head:
>
> put "Tom_iPad" into tArray["data"]["appuser_details"]["name"]
> put "iPad at gmail.com" into tArray["data"]["appuser_details"]["email"]
> ...etc
> put jsonFromArray(tArray) into tJSON
> post tJSON to "http://xxx.xxx"
>
> You might have to twiddle that a bit.
Ah... how is that library working out if something is a number or a string? If it's doing it's just using "is a number" then given you have numbers that you need to send as strings you're going to have a problem. You might need to look at the api and find out if it has a way to force elements to be a string. Alternatively... seeing as it's really not a big document and you don't need to do JSONToArray you could just put a template in a custom property and use merge...
Cheers
--
M E R Goulding
Software development services
Bespoke application development for vertical markets
mergExt - There's an external for that!
More information about the use-livecode
mailing list