Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Parse JSON Returned in ColdFusion

I'm sure this is a relatively simple question, but I can't seem to find a simple answer anywhere online.

I have a few lines of JSON returned by a cfhttp POST with an image URL that I'd like to parse out and display in my ColdFusion page:

{
    "href": "http://server.arcgisonline.com/arcgis/rest/directories/arcgisoutput/ESRI_StreetMap_World_2D_MapServer/_ags_map734a6ad322dd493e84499d78f027d841.png",
    "width": 854,
    "height": 493,
    "extent": {
        "xmin": -8285407.015562119,
        "ymin": 4944008.4197687358,
        "xmax": -8220129.7934066672,
        "ymax": 4981691.8747132765,
        "spatialReference": {
            "wkid": 102100,
            "latestWkid": 3857
        }
    },
    "scale": 288895.27714399656
}

How can I make "href"'s value a part of a variable in ColdFusion, and/or potentially have a button linked to downloading it?

EDIT: I forgot to mention that I'm using ColdFusion MX - also known as version 6 - and hence why I cannot use the DeserializeJSON listed on Adobe's page

like image 875
jaychman Avatar asked Feb 04 '26 05:02

jaychman


1 Answers

Converts a JSON (JavaScript Object Notation) string data representation into CFML data, such as a CFML structure or array.

https://wikidocs.adobe.com/wiki/display/coldfusionen/DeserializeJSON

like image 73
Henry Avatar answered Feb 06 '26 11:02

Henry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!