src/Parser/RequestParser.php
public function parse($content)
    {
        $content = $this->normalize($content);

        list($method, $path, $scheme) = $this->getStatus($content);

        // resolve uri path
        if ($this->baseUrl !== null) {
            $path = UriResolver::resolve($this->baseUrl, new Uri($path));
        } else {
            $path = new Uri($path);
        }

        $request = new Request($path, $method);
        $request->setProtocolVersion($scheme);

        list($header, $body) = $this->splitMessage($content);

        $this->headerToArray($request, $header);

        $request->setBody(new StringStream($body));

        return $request;
    }
public function parse($content)
    {
        $content = $this->normalize($content);

        list($method, $path, $scheme) = $this->getStatus($content);

        // resolve uri path
        if ($this->baseUrl !== null) {
            $path = UriResolver::resolve($this->baseUrl, new Uri($path));
        } else {
            $path = new Uri($path);
        }

        $request = new Request($path, $method);
        $request->setProtocolVersion($scheme);

        list($header, $body) = $this->splitMessage($content);

        $this->headerToArray($request, $header);

        $request->setBody(new StringStream($body));

        return $request;
    }
public function parse ( $ content ) { $ content = $ this -> normalize ( $ content ) ; list ( $ method , $ path , $ scheme ) = $ this -> getStatus ( $ content ) ; // resolve uri path if ( $ this -> baseUrl !== null ) { $ path = UriResolver :: resolve ( $ this -> baseUrl , new Uri ( $ path ) ) ; } else { $ path = new Uri ( $ path ) ; } $ request = new Request ( $ path , $ method ) ; $ request -> setProtocolVersion ( $ scheme ) ; list ( $ header , $ body ) = $ this -> splitMessage ( $ content ) ; $ this -> headerToArray ( $ request , $ header ) ; $ request -> setBody ( new StringStream ( $ body ) ) ; return $ request ; }
Converts an raw http request into an PSX\Http\Request object

@param string $content
@return \PSX\Http\Request
@throws \PSX\Http\Parser\ParseException
Converts an raw http request into an PSX \ Http \ Request object