Esempio n. 1
0
 protected function sendRequestLine(StreamInterface $stream, HttpRequest $request)
 {
     $uri = $request->getUri();
     $buffer = $uri->getPath();
     if ($buffer === '' || substr($buffer, 0, 1) != '/') {
         $buffer = '/' . $buffer;
     }
     if ('' !== ($query = $buffer->getQueryString())) {
         $buffer .= '?' . $query;
     }
     $stream->write(sprintf("%s %s %s\r\n", $request->getMethod(false), $buffer, $request->getProtocol()));
 }