如何解析在ColdFusion中返回的JSON [英] 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.
我有几行JSON由cfhttp POST返回,其中包含我想要解析并显示在ColdFusion页面中的图片网址:
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的值成为变量,和/或可能有一个按钮链接到下载它?
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 - 因此为什么我无法使用反序列化
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屋!