head() public method

Send HEAD request.
public head ( string $path = null, array $data = [], array $options = [] ) : string
$path string
$data array
$options array
return string
Exemplo n.º 1
0
 public function testHeadQueryString()
 {
     $http = new Service($this->_testConfig);
     $expected = array('foo' => 'bar');
     $result = $http->head('/', $expected);
     $this->assertEqual($expected, $http->last->request->query);
 }
Exemplo n.º 2
0
 public function testCurlGet()
 {
     $service = new Service(array('classes' => array('socket' => '\\lithium\\net\\socket\\Curl')));
     $service->head();
     $expected = array('code' => 200, 'message' => 'OK');
     $result = $service->last->response->status;
     $this->assertEqual($expected, $result);
 }
Exemplo n.º 3
0
 public function testHead()
 {
     $http = new Service($this->_testConfig);
     $this->assertEqual('', $http->head());
     $this->assertEqual('HTTP/1.1', $http->last->response->protocol);
     $this->assertEqual('200', $http->last->response->status['code']);
     $this->assertEqual('OK', $http->last->response->status['message']);
     $this->assertEqual('text/html', $http->last->response->type);
     $this->assertEqual('UTF-8', $http->last->response->encoding);
     $this->assertEqual('', $http->last->response->body());
 }