1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-24 18:13:00 +01:00

Fixing issue with setting options on head requests. Closes #352

This commit is contained in:
Michael Dowling 2013-06-23 10:19:47 -07:00
parent 04d554f6d4
commit cae4acd96f
2 changed files with 8 additions and 1 deletions

View File

@ -244,7 +244,7 @@ class Client extends AbstractHasDispatcher implements ClientInterface
public function head($uri = null, $headers = null, array $options = array())
{
return $this->createRequest('HEAD', $uri, $headers, $options);
return $this->createRequest('HEAD', $uri, $headers, null, $options);
}
public function delete($uri = null, $headers = null, $body = null, array $options = array())

View File

@ -574,4 +574,11 @@ class ClientTest extends \Guzzle\Tests\GuzzleTestCase
$client->setDefaultOption('allow_redirects', false);
$this->assertFalse($client->getDefaultOption('allow_redirects'));
}
public function testHeadCanUseOptions()
{
$client = new Client();
$head = $client->head('http://www.foo.com', array(), array('query' => array('foo' => 'bar')));
$this->assertEquals('bar', $head->getQuery()->get('foo'));
}
}