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
@@ -251,6 +251,16 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('John', $response->body->queryString->name[1]);
|
||||
}
|
||||
|
||||
// HEAD
|
||||
public function testHead()
|
||||
{
|
||||
$response = Request::head('http://mockbin.com/request?name=Mark', array(
|
||||
'Accept' => 'application/json'
|
||||
));
|
||||
|
||||
$this->assertEquals(200, $response->code);
|
||||
}
|
||||
|
||||
// POST
|
||||
public function testPost()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user