head() 공개 메소드

Send HEAD request.
public head ( string $path = null, array $data = [], array $options = [] ) : string
$path string
$data array
$options array
리턴 string
예제 #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);
 }
예제 #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);
 }
예제 #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());
 }