Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Update build query support function #311

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions azure-storage-common/src/Common/Internal/ServiceRestProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ protected function createRequest(

// add query parameters into headers
if ($queryParams != null) {
$queryString = Psr7\build_query($queryParams);
$queryString = "";
if (function_exists('Psr7\build_query')) {
$queryString = Psr7\build_query($queryParams);
} elseif (function_exists('http_build_query')) {
$queryString = http_build_query($queryParams);
}
$uri = $uri->withQuery($queryString);
}

Expand All @@ -306,7 +311,11 @@ protected function createRequest(
if (empty($body)) {
if (empty($headers[Resources::CONTENT_TYPE])) {
$headers[Resources::CONTENT_TYPE] = Resources::URL_ENCODED_CONTENT_TYPE;
$actualBody = Psr7\build_query($postParameters);
if (function_exists('Psr7\build_query')) {
$actualBody = Psr7\build_query($postParameters);
} elseif (function_exists('http_build_query')) {
$actualBody = http_build_query($postParameters);
}
}
} else {
$actualBody = $body;
Expand Down