Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 解析服务器响应的策略_Php_Android_Json_Api - Fatal编程技术网

Php 解析服务器响应的策略

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 ←

我正在使用一个库对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
← 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);