Fixup HTTP headers for httpClient requests
This commit is contained in:
parent
c7f54d83ce
commit
2356221aba
12 changed files with 36 additions and 33 deletions
|
@ -976,7 +976,7 @@ class DFRN
|
|||
|
||||
$content_type = ($public_batch ? "application/magic-envelope+xml" : "application/json");
|
||||
|
||||
$postResult = DI::httpRequest()->post($dest_url, $envelope, ["Content-Type: " . $content_type]);
|
||||
$postResult = DI::httpRequest()->post($dest_url, $envelope, ['Content-Type' => $content_type]);
|
||||
$xml = $postResult->getBody();
|
||||
|
||||
$curl_stat = $postResult->getReturnCode();
|
||||
|
|
|
@ -3022,7 +3022,7 @@ class Diaspora
|
|||
if (!intval(DI::config()->get("system", "diaspora_test"))) {
|
||||
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
|
||||
|
||||
$postResult = DI::httpRequest()->post($dest_url . "/", $envelope, ["Content-Type: " . $content_type]);
|
||||
$postResult = DI::httpRequest()->post($dest_url . "/", $envelope, ['Content-Type' => $content_type]);
|
||||
$return_code = $postResult->getReturnCode();
|
||||
} else {
|
||||
Logger::log("test_mode");
|
||||
|
|
|
@ -727,7 +727,7 @@ class OStatus
|
|||
|
||||
self::$conv_list[$conversation] = true;
|
||||
|
||||
$curlResult = DI::httpRequest()->get($conversation, ['accept_content' => 'application/atom+xml, text/html']);
|
||||
$curlResult = DI::httpRequest()->get($conversation, ['accept_content' => ['application/atom+xml', 'text/html']]);
|
||||
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
|
||||
return;
|
||||
|
@ -921,7 +921,7 @@ class OStatus
|
|||
}
|
||||
|
||||
$stored = false;
|
||||
$curlResult = DI::httpRequest()->get($related, ['accept_content' => 'application/atom+xml, text/html']);
|
||||
$curlResult = DI::httpRequest()->get($related, ['accept_content' => ['application/atom+xml', 'text/html']]);
|
||||
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
|
||||
return;
|
||||
|
|
|
@ -156,8 +156,8 @@ class Salmon
|
|||
|
||||
// slap them
|
||||
$postResult = DI::httpRequest()->post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
'Content-type' => 'application/magic-envelope+xml',
|
||||
'Content-length' => strlen($salmon),
|
||||
]);
|
||||
|
||||
$return_code = $postResult->getReturnCode();
|
||||
|
@ -181,8 +181,8 @@ class Salmon
|
|||
|
||||
// slap them
|
||||
$postResult = DI::httpRequest()->post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
'Content-type' => 'application/magic-envelope+xml',
|
||||
'Content-length' => strlen($salmon),
|
||||
]);
|
||||
$return_code = $postResult->getReturnCode();
|
||||
}
|
||||
|
@ -204,8 +204,8 @@ class Salmon
|
|||
|
||||
// slap them
|
||||
$postResult = DI::httpRequest()->post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)]);
|
||||
'Content-type' => 'application/magic-envelope+xml',
|
||||
'Content-length' => strlen($salmon)]);
|
||||
$return_code = $postResult->getReturnCode();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue