mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
Helper for HTTP POSTs: can return the headers if requested
SVN:trunk[2971]
This commit is contained in:
@@ -889,7 +889,7 @@ class utils
|
||||
* @return string The result of the POST request
|
||||
* @throws Exception
|
||||
*/
|
||||
static public function DoPostRequest($sUrl, $aData, $sOptionnalHeaders = null)
|
||||
static public function DoPostRequest($sUrl, $aData, $sOptionnalHeaders = null, &$aResponseHeaders = null)
|
||||
{
|
||||
// $sOptionnalHeaders is a string containing additional HTTP headers that you would like to send in your request.
|
||||
|
||||
@@ -928,6 +928,11 @@ class utils
|
||||
{
|
||||
throw new Exception("Problem reading data from $sUrl, $php_errormsg");
|
||||
}
|
||||
if (is_array($aResponseHeaders))
|
||||
{
|
||||
$aMeta = stream_get_meta_data($fp);
|
||||
$aResponseHeaders = $aMeta['wrapper_data'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user