コード例 #1
0
 internal GetReadStreamResult(
     object source,
     string method,
     HttpWebRequest request,
     AsyncCallback callback,
     object state)
     : base(source, method, callback, state)
 {
     Debug.Assert(request != null, "Null request can't be wrapped to a result.");
     this.request = request;
     this.Abortable = request;
 }
コード例 #2
0
ファイル: WebUtil.cs プロジェクト: mderazon/dobberman
 internal static void ApplyHeadersToRequest(Dictionary<string, string> headers, HttpWebRequest request, bool ignoreAcceptHeader)
 {
     foreach (KeyValuePair<string, string> header in headers)
     {
         if (string.Equals(header.Key, XmlConstants.HttpRequestAccept, StringComparison.Ordinal))
         {
             if (!ignoreAcceptHeader)
             {
                 request.Accept = header.Value;
             }
         }
         else if (string.Equals(header.Key, XmlConstants.HttpContentType, StringComparison.Ordinal))
         {
             request.ContentType = header.Value;
         }
         else
         {
             request.Headers[header.Key] = header.Value;
         }
     }
 }