mirror of
https://github.com/friendica/friendica
synced 2025-04-27 09:10:12 +00:00
Curl Response Refactoring
- refactored Network::post() - replaced every Network::post() execution with the new Curl container
This commit is contained in:
parent
2dec8895a9
commit
7c73e8634c
10 changed files with 24 additions and 25 deletions
|
@ -133,13 +133,12 @@ class Salmon
|
|||
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
|
||||
|
||||
// slap them
|
||||
Network::post($url, $salmon, [
|
||||
$postResult = Network::post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
]);
|
||||
|
||||
$a = get_app();
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
$return_code = $postResult->getReturnCode();
|
||||
|
||||
// check for success, e.g. 2xx
|
||||
|
||||
|
@ -159,11 +158,11 @@ class Salmon
|
|||
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
|
||||
|
||||
// slap them
|
||||
Network::post($url, $salmon, [
|
||||
$postResult = Network::post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
]);
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
$return_code = $postResult->getReturnCode();
|
||||
}
|
||||
|
||||
if ($return_code > 299) {
|
||||
|
@ -182,10 +181,10 @@ class Salmon
|
|||
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
|
||||
|
||||
// slap them
|
||||
Network::post($url, $salmon, [
|
||||
$postResult = Network::post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)]);
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
$return_code = $postResult->getReturnCode();
|
||||
}
|
||||
|
||||
logger('slapper for '.$url.' returned ' . $return_code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue