IDictionary<String, String> parseContent(String content) { using (Stream data = GenerateStreamFromString(content)) { if (content.StartsWith("multipart/form-data")) { HttpMultipartParser parser = new HttpMultipartParser(data, "image"); if (parser.Success) { return parser.Parameters; } else { return new Dictionary<String, String>(); } } else { HttpContentParser parser = new HttpContentParser(data); if (parser.Success) { return parser.Parameters; } else { return new Dictionary<String, String>(); } } } }
IDictionary<String, String> parseContent(String content) { using (Stream data = GenerateStreamFromString(content)) { if (content.StartsWith("multipart/form-data")) { HttpMultipartParser parser = new HttpMultipartParser(data, "image"); if (parser.Success) { return parser.Parameters; } else { return new Dictionary<String, String>(); } } else { HttpContentParser parser = new HttpContentParser(data); if (parser.Success) { Dictionary<string, string> decodedParameters = new Dictionary<string, string>(); foreach (var p in parser.Parameters) { decodedParameters.Add(p.Key,HttpUtility.UrlDecode(p.Value)); } return decodedParameters; } else { return new Dictionary<String, String>(); } } } }