Skip to content
Snippets Groups Projects
Commit ac0150a3 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent 92161a9b
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment