function discourse_fetch_post($host, $topic, $pid)
{
$url = $host . '/t/' . $topic . '/' . $pid . '.json';
- $curlResult = DI::httpRequest()->curl($url);
+ $curlResult = DI::httpRequest()->get($url);
if (!$curlResult->isSuccess()) {
Logger::info('No success', ['url' => $url]);
return false;
{
$hostaddr = 'https://' . $host;
$url = $hostaddr . '/posts/' . $post . '.json';
- $curlResult = DI::httpRequest()->curl($url);
+ $curlResult = DI::httpRequest()->get($url);
if (!$curlResult->isSuccess()) {
return false;
}
$j = DI::cache()->get($cachekey);
if (is_null($j)) {
- $curlResult = DI::httpRequest()->curl($nomserver . $args);
+ $curlResult = DI::httpRequest()->get($nomserver . $args);
if ($curlResult->isSuccess()) {
$j = json_decode($curlResult->getBody(), true);
DI::cache()->set($cachekey, $j, Duration::MONTH);
function pumpio_reachable($url)
{
- return DI::httpRequest()->curl($url, false, ['timeout' => 10])->isSuccess();
+ return DI::httpRequest()->get($url, false, ['timeout' => 10])->isSuccess();
}
/*