// string, not AString, as parameters can be non-ASCII public void ParseParams(AString paramStr) { Params.Clear(); paramStr = paramStr.InPlaceUrlDecode(); var paramParts = paramStr.Split('&'); for (int i = 0; i < paramParts.Length; i++) { var pp = paramParts[i].Split('='); Params.Add(pp[0].ToString(), pp[1].ToString()); if (pp[0] == "query_id") { pp[1].TryToInt(out QueryId); } } }
public void ParseFirstLine(AString firstLine) { var parts = firstLine.Split(' '); Trace.Assert(parts.Length == 3); Method = parts[0]; var pathParts = parts[1].Split('?'); Path = pathParts[0]; if (pathParts.Length == 1 || pathParts[1].IsEmpty) { Params.Clear(); } else { ParseParams(pathParts[1]); } }