我最近开始使用来自https://www.mashape.com/的 API ,我相信我已经获得了我需要的数据,但我不太确定如何使用它。它返回(我相信)一个我尝试将类型转换为数组的对象,但我仍然没有成功提取我需要的数据。该对象看起来像:
Unirest\HttpResponse Object
(
[code:Unirest\HttpResponse:private] => 200
[raw_body:Unirest\HttpResponse:private] => {
"_": {
"APP_ID": "server_tracked"
},
"success": true,
"requestTime": "2013-08-21T21:02:59-07:00",
"shard": "North_America:YjNmMjE4YmVhZjgxN2M0ZGI0ZTU1YzQ0MWZiMzQ5MGJkMjFhMGRmOA",
"data": {
"accountId": 37774341,
"summonerId": 23638303,
"name": "Naughtlok",
"icon": 550,
"internalName": "naughtlok",
"level": 30
}
}
[body:Unirest\HttpResponse:private] => stdClass Object
(
[_] => stdClass Object
(
[APP_ID] => server_tracked
)
[success] => 1
[requestTime] => 2013-08-21T21:02:59-07:00
[shard] => North_America:YjNmMjE4YmVhZjgxN2M0ZGI0ZTU1YzQ0MWZiMzQ5MGJkMjFhMGRmOA
[data] => stdClass Object
(
[accountId] => 37774341
[summonerId] => 23638303
[name] => Naughtlok
[icon] => 550
[internalName] => naughtlok
[level] => 30
)
)
[headers:Unirest\HttpResponse:private] => Array
(
[content-type] => application/json; charset=utf-8
[date] => Thu, 22 Aug 2013 04:02:59 GMT
[server] => Apache-Coyote/1.1
[x-api-calls-remaining] => -1
[X-Mashape-Proxy-Response] => false
[X-Mashape-Version] => 3.1.1
[transfer-encoding] => chunked
[Connection] => keep-alive
)
)
关于我可以从“数据”中获得例如“级别”的任何指针?