diff --git a/azure-storage-common/src/Common/Internal/ServiceRestProxy.php b/azure-storage-common/src/Common/Internal/ServiceRestProxy.php index 1b911e59..b37b69a2 100644 --- a/azure-storage-common/src/Common/Internal/ServiceRestProxy.php +++ b/azure-storage-common/src/Common/Internal/ServiceRestProxy.php @@ -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); } @@ -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;