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

This commit is contained in:
nupplaPhil 2020-03-04 22:07:05 +01:00 committed by Hypolite Petovan
parent 2889d59b83
commit 5344efef71
43 changed files with 528 additions and 485 deletions

View file

@ -22,9 +22,9 @@
namespace Friendica\Protocol;
use Friendica\Core\Logger;
use Friendica\Network\HTTPRequest;
use Friendica\Network\Probe;
use Friendica\Util\Crypto;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\XML;
@ -72,7 +72,7 @@ class Salmon
$ret[$x] = substr($ret[$x], 5);
}
} elseif (Strings::normaliseLink($ret[$x]) == 'http://') {
$ret[$x] = Network::fetchUrl($ret[$x]);
$ret[$x] = HTTPRequest::fetchUrl($ret[$x]);
}
}
}
@ -155,7 +155,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
$postResult = Network::post($url, $salmon, [
$postResult = HTTPRequest::post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
]);
@ -180,7 +180,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
$postResult = Network::post($url, $salmon, [
$postResult = HTTPRequest::post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
]);
@ -203,7 +203,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
$postResult = Network::post($url, $salmon, [
$postResult = HTTPRequest::post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)]);
$return_code = $postResult->getReturnCode();