Commit ac0150a3 authored by alexpott's avatar alexpott

Issue #2274153 by dixon_, Wim Leers: Make RESTTestBase::httpRequest() work with HEAD requests

parent 92161a9b
......@@ -93,6 +93,7 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
$url = $this->buildUrl($url);
$curl_options = array();
switch ($method) {
case 'GET':
// Set query if there are additional GET parameters.
......@@ -105,6 +106,16 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
);
break;
case 'HEAD':
$curl_options = array(
CURLOPT_HTTPGET => FALSE,
CURLOPT_CUSTOMREQUEST => 'HEAD',
CURLOPT_URL => $url,
CURLOPT_NOBODY => TRUE,
CURLOPT_HTTPHEADER => array('Accept: ' . $mime_type),
);
break;
case 'POST':
$curl_options = array(
CURLOPT_HTTPGET => FALSE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment