Пример #1
0
 /**
  *    Sends the headers.
  *    @param SimpleSocket $socket           Open socket.
  *    @param string $method                 HTTP request method,
  *                                          usually GET.
  *    @param SimpleFormEncoding $encoding   Content to send with request.
  *    @access private
  */
 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);
 }
Пример #2
0
 /**
  * Sends the headers.
  *
  * @param SimpleSocket $socket           Open socket.
  * @param string $method                 HTTP request method, usually GET.
  * @param SimpleFormEncoding $encoding   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);
 }