Пример #1
0
 public void AddExtraHeader(string header, object value)
 {
     if (value != null && !RawHeaders.ContainsKey(header))
     {
         RawHeaders.Add(header, value);
     }
 }
Пример #2
0
        /// <summary>
        ///     Adds a single header or updates it if it already exists
        /// </summary>
        /// <param name="headerName">The name of the header</param>
        /// <param name="headerValue">The value for the header</param>
        public void SetHeaderValue(string headerName, string headerValue)
        {
            if (!RawHeaders.ContainsKey(headerName))
            {
                RawHeaders.Add(headerName, new List <string> {
                    headerValue
                });
            }
            else
            {
                RawHeaders[headerName] = new List <string> {
                    headerValue
                }
            };

            ParseHeader(headerName, headerValue);
        }
Пример #3
0
 /// <summary>
 ///     Returns the value(s) of the header, <c>null</c> will be returned when the
 ///     header does not exist
 /// </summary>
 /// <param name="headerName">The name of the header</param>
 public string HeaderValue(string headerName)
 {
     return(RawHeaders.ContainsKey(headerName) ? string.Join(Environment.NewLine, RawHeaders[headerName]) : null);
 }