我现在服务的 json 输出是
[{"errno": "0","num_keys": "0"},
{"errno": "1","num_keys": "2"},
{"errno": "3","num_keys": "4"},
{"errno": "5","num_keys": "6"}]
在此,如果键 errno 和 num_keys,我想提取每个值。
我正在使用以下代码:
var request = new sn_ws.RESTMessageV2();
request.setEndpoint("url");
request.setHttpMethod('GET');
request.setRequestHeader('Content-Type','application/json');
request.setRequestHeader('X-IPM-Username','some name');
request.setRequestHeader('X-IPM-Password','some password');
var response = request.execute();
var result=response.getBody();
这里如何提取值?
var result=response.json();