LC8 - Stumbling into JSON

Mark Wieder mwieder at ahsoftware.net
Mon Jun 13 19:19:43 EDT 2016


Sannyasin Brahmanathaswami <brahma at ...> writes:

> http://api.clinicalcalculator.org/bmi?height_in_m=1.778&weight_in_kg=68
> 
> returns a 2 dimensional array, 2  elements, each of which contains 2 elements
> 
> {"result":
>     {"value":18.75,
>     "units":"kg/m^2"
>     },
> "request_fields":
>     {"height_in_m":"2",
>     "weight_in_kg":"75"
>          }
>     }
> 
> Graham wrote: "Where did the names ‘result’ and ‘value’ come from?"
> 
> They came from the first JSON name/value pair
> Hope that helps

And just FYI, for comparison the xml translation of that would be

<json_object_in_xml>
  <result>
    <value>18.75</value>
    <units>kg/m at 2</units>
  </result>
  <request_fields>
    <height_in_m>2</height_in_m>
    <weight_in_kg>75</weight_in_kg>
  </request_fields>
</json_object_in_xml>

-- 
 Mark Wieder
 ahsoftware at gmail.com


More information about the Use-livecode mailing list