public static function fromURL ($url, $stripHost) {

		$data = parse_url ($url);

		$parameters = array ();

		if (!empty ($data['query']))
			parse_str ($data['query'], $parameters);

		$request = new self ();

		if ($stripHost) {
			$request->setUrl ($data['path']);
		}

		else {
			$request->setUrl (
				$data['scheme'] . '://' .
				$data['host'] . (isset ($data['port']) ? ':' . $data['port'] : '') .
				$data['path']
			);
		}

		$request->setParameters ($parameters);

		return $request;

	}