我创建了一个脚本,从以下https://insuredhq.atlassian.net/
获取所有文章是我使用过的代码。
$username = '##########';
$password = '##########';
$url = "https://insuredhq.atlassian.net/wiki/rest/api/content?spaceKey=IUM&id=Completing%20a%20Task&expand=space,body.view,version,container";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
curl_close($ch);//print_r($result);
$result = json_decode($result);
echo "<pre>";
print_r($result);
我已经检查了那些图像src属性,它们是动态网址,例如/wiki/download/attachments/13303822/Dashboard.png?version=1&modificationDate=1462935137147&api=v2
,甚至我将它们更改为静态网址,例如https://insuredhq.atlassian.net/wiki/download/attachments/13303822/Dashboard.png?version=1&modificationDate=1462935137147&api=v2
,但它们仍未显示。
有关详细示例,请查看此链接http://hunaniinfotech.com/insecuredhq/article.php?id=13303841