Php 解析服务器响应的策略
我正在使用一个库对Instagram API进行API调用。我得到的回应如下:Php 解析服务器响应的策略,php,android,json,api,Php,Android,Json,Api,我正在使用一个库对Instagram API进行API调用。我得到的回应如下: POST: https://i.instagram.com/api/v1/feed/timeline/ DATA: is_prefetch=0&feed_view_info=&seen_posts=&phone_id=4c14088a-94b7-49c3-bec3-12caad443c50&reason=pull_to_refresh&battery_level=100 ←
POST: https://i.instagram.com/api/v1/feed/timeline/
DATA: is_prefetch=0&feed_view_info=&seen_posts=&phone_id=4c14088a-94b7-49c3-bec3-12caad443c50&reason=pull_to_refresh&battery_level=100
← 200 15.19kB
RESPONSE: {"response": "Random Json Response"}
我想从这里得到响应键的值。
解析它的策略是什么?或者这是一种特殊的软件架构风格,如SOAP或REST?您可能正在寻找的是功能 您可以这样使用它:
$response = apache_request_headers();
print_r($response);
这将生成一个数组,您可以在其中检索所需的信息
响应:
数据采用JSON格式。因此,您需要将其转换为如下所示的数组:
$responseData = json_decode($responseData, true);
print_r($responseData);