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; }
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; } } }