parseRequest() public method

Parse given string and return HttpRequestInterface object.
public parseRequest ( string $message ) : Kraken\Network\Http\HttpRequestInterface
$message string
return Kraken\Network\Http\HttpRequestInterface
Example #1
0
 /**
  * @override
  * @inheritDoc
  */
 public function readRequest(BufferInterface $buffer, $data)
 {
     $buffer->push($data);
     if (($position = $buffer->search(self::HTTP_EOM)) === false) {
         if ($buffer->length() > $this->maxFrameSize) {
             throw new ReadException(sprintf('Message start line exceeded maximum size of %d bytes.', $this->maxFrameSize));
         }
         return null;
     }
     try {
         return $this->parser->parseRequest($buffer->drain());
     } catch (Error $ex) {
     } catch (Exception $ex) {
     }
     throw new InvalidFormatException('Could not parse start line.', $ex);
 }