X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FSalmon.php;h=95bddcd6553b5d6c4e0efb7e428d5c6de086466d;hb=da3fbced38d48459ea0adf38eabb2af8207f59ae;hp=81b1f7528d67f7725e0d0c96027b997505970e2c;hpb=53e38b03130ea798bba44db44ccb7f331dc4b91d;p=friendica.git diff --git a/src/Protocol/Salmon.php b/src/Protocol/Salmon.php index 81b1f7528d..95bddcd655 100644 --- a/src/Protocol/Salmon.php +++ b/src/Protocol/Salmon.php @@ -72,7 +72,7 @@ class Salmon $ret[$x] = substr($ret[$x], 5); } } elseif (Strings::normaliseLink($ret[$x]) == 'http://') { - $ret[$x] = DI::httpRequest()->fetch($ret[$x]); + $ret[$x] = DI::httpClient()->fetch($ret[$x]); } } } @@ -155,9 +155,9 @@ class Salmon $salmon = XML::fromArray($xmldata, $xml, false, $namespaces); // slap them - $postResult = DI::httpRequest()->post($url, $salmon, [ - 'Content-type: application/magic-envelope+xml', - 'Content-length: ' . strlen($salmon) + $postResult = DI::httpClient()->post($url, $salmon, [ + 'Content-type' => 'application/magic-envelope+xml', + 'Content-length' => strlen($salmon), ]); $return_code = $postResult->getReturnCode(); @@ -180,9 +180,9 @@ class Salmon $salmon = XML::fromArray($xmldata, $xml, false, $namespaces); // slap them - $postResult = DI::httpRequest()->post($url, $salmon, [ - 'Content-type: application/magic-envelope+xml', - 'Content-length: ' . strlen($salmon) + $postResult = DI::httpClient()->post($url, $salmon, [ + 'Content-type' => 'application/magic-envelope+xml', + 'Content-length' => strlen($salmon), ]); $return_code = $postResult->getReturnCode(); } @@ -203,9 +203,9 @@ class Salmon $salmon = XML::fromArray($xmldata, $xml, false, $namespaces); // slap them - $postResult = DI::httpRequest()->post($url, $salmon, [ - 'Content-type: application/magic-envelope+xml', - 'Content-length: ' . strlen($salmon)]); + $postResult = DI::httpClient()->post($url, $salmon, [ + 'Content-type' => 'application/magic-envelope+xml', + 'Content-length' => strlen($salmon)]); $return_code = $postResult->getReturnCode(); } @@ -215,7 +215,7 @@ class Salmon return -1; } - if (($return_code == 503) && (stristr($postResult->getHeader(), 'retry-after'))) { + if (($return_code == 503) && $postResult->inHeader('retry-after')) { return -1; }