Esempio n. 1
0
        static bool AppendResult(
            string line,
            ref string currentRequestLine,
            HttpHeaderEntries currentEntries)
        {
            string key, value;

            // We found a blank line! Header ends here.
            if (string.IsNullOrWhiteSpace(line))
            {
                return(false);
            }
            // We found a request line
            else if (currentRequestLine == null)
            {
                currentRequestLine = line;
            }
            // We found a header key:value line
            else
            {
                HttpHeaderLineParser.Parse(line, out key, out value);
                currentEntries.Add(key, value);
            }

            return(true);
        }
 static void AddToHeader(string line, HttpHeader header)
 {
     HttpHeaderLineParser.Parse(line, out string key, out string value);
     header.Add(key, value);
 }