【发布时间】:2016-06-22 13:34:05
【问题描述】:
在此之前我没有发出过 WordPress http 请求。我是第一次这样做,但没有收到回复。似乎响应不是我正在使用的 API 的预期,文档描述了我们可以获得的一些参数作为回报,但我在响应中找不到任何这些参数。
这是我的测试代码:
$response1 = wp_remote_get('https://api.duoservers.com/?auth_usernme=theapiusername&auth_password=theapipassword§ion=products&command=get_plans');
print_r($response1);
以上代码生成以下输出:
( [headers] => Array ( [server] => nginx [date] => Wed, 22 Jun 2016 08:34:50 GMT [content-type] => text/html; charset=UTF-8 [content-length] => 182 [connection] => close [vary] => Accept-Encoding [content-encoding] => gzip ) [body] => 0 1 0.017 s 0.004 s 6079653986 0 [response] => Array ( [code] => 200 [message] => OK ) [cookies] => Array ( ) [filename] => ) 0 1 0.016 s 0.005 s 6687868871 0
有人可以解释一下上述回复的实际含义吗?
这是我第一次使用WordPress HTTP请求发送,所以我很困惑。
【问题讨论】:
标签: php wordpress http-request