我
使用Net /
http从Yahoo Placemaker API中提取一些json数据.收到回复后,我在响应中执行JSON.parse.这给我一个哈希,看起来像:
@H_
197_2@
{"processingTime"=>"0.001493","version"=>"1.4.0.526 build 111113","documentLength"=>"25","document"=>
{"administrativeScope"=>
{"wo
EID"=>"2503863","type"=>"Town","name"=>"Tampa,FL,US","centroid"=>
{"latitude"=>"27.9465","longitude"=>"-82.4593"}},"geographicScope"=>
{"wo
EID"=>"2503863","localScopes"=>
{"localScope"=>
{"wo
EID"=>"2503863",US (Town)","longitude"=>"-82.4593"},"south
West"=>
{"latitude"=>"27.8132","longitude"=>"-82.6
489"},"northEast"=>
{"latitude"=>"28.1714","longitude"=>"-82.2539"},"ancestors"=>[
{"ancestor"=>
{"wo
EID"=>"12587831","type"=>"
county","name"=>"Hillsborough"}},
{"ancestor"=>
{"wo
EID"=>"2347568","type"=>"State","name"=>"Florida"}},
{"ancestor"=>
{"wo
EID"=>"23424977","type"=>"Country","name"=>"United States"}}]}},"
extents"=>
{"center"=>
{"latitude"=>"27.9465","longitude"=>"-82.2539"}},"placeDetails"=>
{"plac
EID"=>"1","place"=>
{"wo
EID"=>"2503863","placeReferenc
EIDs"=>"1","matchType"=>"0","weight"=>"1","confidence"=>"8"},"referenceList"=>
{"reference"=>
{"wo
EIDs"=>"2503863","placeReferenc
EID"=>"1","plac
EIDs"=>"1","start"=>"15","end"=>"20","isPlai
ntextMarker"=>"1","text"=>"Tampa","type"=>"plai
ntext","xpath"=>""}}}}
我可以通过像jsonResponse [‘version’]这样的东西来访问元素,但是我无法做jsonResponse.version.为什么是这样?