feat(HEAD): CURLOPT_NOBODY option for HEAD requests
* When using HEAD requests set the appropriate curl header to not wait for a response body. See http://www.php.net/manual/en/function.curl-setopt.php on CURLOPT_NOBODY. * Add simple test for HEAD request.
This commit is contained in:
committed by
Ahmad Nassri
parent
842c0f242d
commit
14aa9aa691
@@ -399,6 +399,9 @@ class Request
|
||||
if ($method === Method::POST) {
|
||||
curl_setopt(self::$handle, CURLOPT_POST, true);
|
||||
} else {
|
||||
if ($method === Method::HEAD) {
|
||||
curl_setopt(self::$handle, CURLOPT_NOBODY, true);
|
||||
}
|
||||
curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user