public function build($type)
    {
        if (!isset($this->types[$type])) {
            throw new \Exception("Unknown request type.");
        }
        return new $this->types[$type]();
    }
public function build($type)
    {
        if (!isset($this->types[$type])) {
            throw new \Exception("Unknown request type.");
        }
        return new $this->types[$type]();
    }
public function build ( $ type ) { if ( ! isset ( $ this -> types [ $ type ] ) ) { throw new \ Exception ( "Unknown request type." ) ; } return new $ this -> types [ $ type ] ( ) ; }
Builds the request object.

@param string $type The type of request to build.

@throws Exception Throws an exception for unknown request types.

@return \RestPHP\Request The created object.
Builds the request object .