SimpleHttpRequest::dispatchRequest PHP Method

dispatchRequest() protected method

Sends the headers.
protected dispatchRequest ( SimpleSocket $socket, SimpleFormEncoding $encoding )
$socket SimpleSocket Open socket.
$encoding SimpleFormEncoding Content to send with request.
    protected function dispatchRequest($socket, $encoding)
    {
        foreach ($this->headers as $header_line) {
            $socket->write($header_line . "\r\n");
        }
        if (count($this->cookies) > 0) {
            $socket->write('Cookie: ' . implode(';', $this->cookies) . "\r\n");
        }
        $encoding->writeHeadersTo($socket);
        $socket->write("\r\n");
        $encoding->writeTo($socket);
    }