Example #1
0
        /// <summary>
        /// Parses text from an HTTP form body.
        /// </summary>
        /// <param name="text">The HTTP form body to parse.</param>
        /// <returns>The collection containing the parsed HTTP form body.</returns>
        public static IDictionary <string, StringValues> ReadForm(string text)
        {
            var reader = new FormReader(text);

            var accumulator = new KeyValueAccumulator();
            var pair        = reader.ReadNextPair();

            while (pair.HasValue)
            {
                accumulator.Append(pair.Value.Key, pair.Value.Value);
                pair = reader.ReadNextPair();
            }

            return(accumulator.GetResults());
        }
Example #2
0
        /// <summary>
        /// Parses text from an HTTP form body.
        /// </summary>
        /// <param name="text">The HTTP form body to parse.</param>
        /// <returns>The collection containing the parsed HTTP form body.</returns>
        public static IDictionary <string, string[]> ReadForm(string text)
        {
            var reader = new FormReader(text);

            var accumulator = new KeyValueAccumulator <string, string>(StringComparer.OrdinalIgnoreCase);
            var pair        = reader.ReadNextPair();

            while (pair.HasValue)
            {
                accumulator.Append(pair.Value.Key, pair.Value.Value);
                pair = reader.ReadNextPair();
            }

            return(accumulator.GetResults());
        }
Example #3
0
        /// <summary>
        /// Parses text from an HTTP form body.
        /// </summary>
        /// <param name="text">The HTTP form body to parse.</param>
        /// <returns>The collection containing the parsed HTTP form body.</returns>
        public static IDictionary<string, string[]> ReadForm(string text)
        {
            var reader = new FormReader(text);

            var accumulator = new KeyValueAccumulator<string, string>(StringComparer.OrdinalIgnoreCase);
            var pair = reader.ReadNextPair();
            while (pair.HasValue)
            {
                accumulator.Append(pair.Value.Key, pair.Value.Value);
                pair =  reader.ReadNextPair();
            }

            return accumulator.GetResults();
        }
        /// <summary>
        /// Parses text from an HTTP form body.
        /// </summary>
        /// <param name="text">The HTTP form body to parse.</param>
        /// <returns>The collection containing the parsed HTTP form body.</returns>
        public static Dictionary<string, StringValues> ReadForm(string text)
        {
            var reader = new FormReader(text);

            var accumulator = new KeyValueAccumulator();
            var pair = reader.ReadNextPair();
            while (pair.HasValue)
            {
                accumulator.Append(pair.Value.Key, pair.Value.Value);
                pair = reader.ReadNextPair();
            }

            return accumulator.GetResults();
        }