私は最近、 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
)
)
たとえば、「データ」から「レベル」を取得できるポインタはありますか?