如何解析 ColdFusion 中返回的 JSON [英] How to Parse JSON Returned in ColdFusion

查看:15
本文介绍了如何解析 ColdFusion 中返回的 JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确定这是一个相对简单的问题,但我似乎无法在网上任何地方找到简单的答案.

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

我有几行由 cfhttp POST 返回的 JSON 行,其中包含我想解析出来并显示在我的 ColdFusion 页面中的图像 URL:

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
}

如何使href"的值成为 ColdFusion 中变量的一部分,和/或可能有一个链接到下载它的按钮?

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

我忘了提到我正在使用 ColdFusion MX - 也称为版本 6 - 因此我不能使用 反序列化在 Adob​​e 页面上列出的 JSON

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

推荐答案

转换 JSON(JavaScript Object Notation)字符串数据表示为 CFML 数据,例如 CFML 结构或数组.

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

这篇关于如何解析 ColdFusion 中返回的 JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆