-/* $Id$
-
-This file is part of libmsphttp
-Copyright © 2008 Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
#include <msp/strings/formatter.h>
#include <msp/strings/regex.h>
#include <msp/strings/utils.h>
unsigned lf = str.find('\n');
vector<string> parts = split(str.substr(0, lf-(str[lf-1]=='\r')), ' ', 2);
if(parts.size()<3)
- throw InvalidParameterValue("Invalid request");
+ throw invalid_argument("Request::parse");
Request result(parts[0], parts[1]);
result.http_version = parse_version(parts[2]);
{
Url url = parse_url(str);
if(url.scheme!="http")
- throw InvalidParameterValue("Only http scheme is supported");
+ throw invalid_argument("Request::from_url");
+
string path = url.path;
if(path.empty())
path = "/";