Move post/curl/fetchUrl/fetchUrlFull to own class "Network\HTTPRequest"

This commit is contained in:
nupplaPhil 2020-03-04 22:07:04 +01:00 committed by Hypolite Petovan
parent 31bd1a1ba0
commit 9640142a72
18 changed files with 50 additions and 45 deletions

View file

@ -5,11 +5,12 @@
* Version: 0.1
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Util\Network;
use Friendica\Network\HTTPRequest;
use Friendica\Util\Strings;
function geocoordinates_install()
@ -52,7 +53,7 @@ function geocoordinates_resolve_item(&$item)
return;
}
$s = Network::fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language);
$s = HTTPRequest::fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=" . $coords[0] . "," . $coords[1] . "&key=" . $key . "&language=" . $language);
if (!$s) {
Logger::log("API could not be queried", Logger::DEBUG);