X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/928e37f7083dd3320588a26d5dcc6b2d4e4de957..b378751c9e23854724a13e18f1e62295b0eb662b:/lib/utils.inc.php diff --git a/lib/utils.inc.php b/lib/utils.inc.php index e0ab45d..f32e209 100644 --- a/lib/utils.inc.php +++ b/lib/utils.inc.php @@ -384,7 +384,7 @@ class Utils { return $string; } - public function RESTCall($url, $data = null, $cookiesIn = '') { + public function RESTCall($url, $data = null, $cookiesIn = '', $headers = null) { $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => true, //return headers in addition to content @@ -405,6 +405,10 @@ class Utils { $options[CURLOPT_POSTFIELDS] = $data; } + if ($headers) { + $options[CURLOPT_HTTPHEADER] = $headers; + } + $ch = curl_init($url); curl_setopt_array($ch, $options); $rough_content = curl_exec($ch);