X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/5ec97892b8d65ffdff8eef18495632e1c2c7c22e..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);