我有以下代码用于调用返回 JSON 格式如下的 API:-
{
"data": [
{
" Ser": 1,
" No": 1
},
{
" Ser": 2,
" No": 2
},
{
" Ser": 3,
" No": 3
},
{
" Ser": 4,
" No": 4
},
{
" Ser": 5,
" No": 5
},
]
}
代码是: -
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("/json/api/getinfo?type=100");
HttpResponse response = client.execute(request);
// Get the response, how i can loop through the returned JSON and assign the reterned json to a global parameters which i can access from ym system using has values #parameter1# , #parameter2#, etc.
那么如何遍历返回的 JSON 并将其分配给全局参数“NO”呢?此致