Phalcon\Http\Client\Provider\Curl::send PHP Метод

send() защищенный Метод

using custom headers: $customHeader = array( 0 => 'Accept: text/plain', 1 => 'X-Foo: bar', 2 => 'X-Bar: baz', ); $response = $this->send($customHeader);
protected send ( array $customHeader = [], boolean $fullResponse = false ) : Response
$customHeader array An array of values. If not empty then previously added headers gets ignored.
$fullResponse boolean If true returns the full response (including headers).
Результат Phalcon\Http\Client\Response
    protected function send(array $customHeader = [], $fullResponse = false)
    {
        if (!empty($customHeader)) {
            $header = $customHeader;
        } else {
            $header = [];
            if (count($this->header) > 0) {
                $header = $this->header->build();
            }
        }
        $header[] = 'Expect:';
        $header = array_unique($header, SORT_STRING);
        $this->responseHeader = '';
        $this->setOption(CURLOPT_HEADERFUNCTION, [$this, 'headerFunction']);
        $this->setOption(CURLOPT_HTTPHEADER, $header);
        $content = curl_exec($this->handle);
        $this->setOption(CURLOPT_HEADERFUNCTION, null);
        if ($errno = curl_errno($this->handle)) {
            throw new HttpException(curl_error($this->handle), $errno);
        }
        $response = new Response();
        $response->header->parse($this->responseHeader);
        if ($fullResponse) {
            $response->body = $content;
        } else {
            $response->body = substr($content, strlen($this->responseHeader));
        }
        return $response;
    }