public static void CopyTo(this WebHeaderCollection source, IHttpWebRequest desination)
 {
     foreach (IHttpHeader header in source.GetHeaders())
     {
         desination.SetHeader(header.Name, header.Value);
     }
 }
Пример #2
0
        public static IHttpWebRequest WithHeaders(this IHttpWebRequest httpWebRequest, WebHeaderCollection headers)
        {
            foreach (IHttpHeader header in headers.GetHeaders())
            {
                httpWebRequest.SetHeader(header.Name, header.Value);
            }

            return(httpWebRequest);
        }