3

我创建了一个脚本,它从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 属性,它们是动态 url /wiki/download/attachments/13303822/Dashboard.png?version=1&amp;modificationDate=1462935137147&amp;api=v2,甚至我将它们更改为静态 url,https://insuredhq.atlassian.net/wiki/download/attachments/13303822/Dashboard.png?version=1&amp;modificationDate=1462935137147&amp;api=v2但它们仍然没有显示。

有关详细示例,请查看此链接http://hunaniinfotech.com/insecuredhq/article.php?id=13303841

4

0 回答 0