static bool ParseForm(this HttpListenerRequest request, Dictionary <string, string> args) { if (request.ContentType != "application/x-www-form-urlencoded") { return(false); } var str = request.BodyAsString(); if (str == null) { return(false); } foreach (var pair in str.Split('&')) { var nameValue = pair.Split('='); if (nameValue.Length != (1 + 1)) { continue; } args.Add(nameValue[0], WebUtility.UrlDecode(nameValue[1])); } return(true); }