how can I extract multi-depth json data?



This is my json data from our server.



{"id":3,"status":"Fix","severity":"Error","severityCode":2,"state":"Existing","c
ode":"MLK.MUST","message":"Memory leak. Dynamic memory stored in \u0027new_cat\u
0027 allocated through function \u0027malloc\u0027 at line 11 is lost at line 31
","file":"/data001/tools/test/test.c","method":"main","owner":"unowned","taxonom
yName":"C and C++","url":"http://ift.tt/1soZI2p
#goto:project\u003dTest,pid\u003d3"}


If I conver this to xml, I can find the data below from the xml file.



<taxonomyName>C and C++</taxonomyName>


However, If I export xml from my web server menu directly, the file includes 2-depth taxonomies



<taxonomies>
<taxonomy name="C and C++" metaInf=""/>
</taxonomies>


I think that this different result comes out because I generated wrong json data. I used the following code to get json data from my server.



url_string = 'http://ift.tt/1nqUeQ8'
uri = URI(url_string)
res = Net::HTTP.post_form(uri, 'q' => 'ruby')


Could you let me know which of my codes cause this problem?


Thanks alot.


No comments:

Post a Comment