///
/// 单独请求路径可能查询网址
///
string[] subPaths = subparts[1].Split(new string[] { "?" }, StringSplitOptions.RemoveEmptyEntries);
req.Path = subPaths[0];
req.Paths = subPaths[0].Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries).ToList();
}
}
//保存在字典中查询网址:req.UrlParameters
string[] queryparams = HttpHelper.GetUrlQueries(HttpHelper.RemoveToken(req.CompletePath));
foreach (string p in queryparams)
{
string[] query = p.Split(new String[] { "=" }, StringSplitOptions.RemoveEmptyEntries);
if (query.Length == 2)
{
req.UrlParameters.Add(query[0], query[1]);
}
}
}
catch (Exception)
{
//如果somethig出错验证返回false。
req = null;
return false;
}
req.Type = request;
return true;
}
HTTP服务器软件系统的设计与实现(15):http://www.751com.cn/jisuanji/lunwen_3170.html