PicoFeed\Client\Curl::doRequest PHP Метод

doRequest() публичный Метод

Do the HTTP request.
public doRequest ( ) : array
Результат array HTTP response ['body' => ..., 'status' => ..., 'headers' => ...]
    public function doRequest()
    {
        $this->executeContext();
        list($status, $headers) = HttpHeaders::parse(explode("\n", $this->response_headers[$this->response_headers_count - 1]));
        if ($this->isRedirection($status)) {
            return $this->handleRedirection($headers['Location']);
        }
        return array('status' => $status, 'body' => $this->body, 'headers' => $headers);
    }

Usage Example

Пример #1
0
 /**
  * @expectedException PicoFeed\Client\InvalidUrlException
  */
 public function testBadUrl()
 {
     $client = new Curl();
     $client->setUrl('http://12345gfgfgf');
     $client->doRequest();
 }