-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
Description
hi,I want to implement the download file to support the breakpoint resume.I try to add header "Range:bytes=0-100". But i get a ArgumentException in Request.MakeRequest() function,line
request.Headers = GetHeadersFromProvider(headers.GetHeaders());
Dictionary<String, String> headers = new Dictionary<string, string>();
headers.Add("Range", "bytes=0-100");
DictionaryHeaderProvider provider = new DictionaryHeaderProvider(headers);
RequestBuilder rb = Http.Get("https://blog.csdn.net/");
rb.Headers(provider);
rb.Go();
msdn:
https://msdn.microsoft.com/ZH-CN/library/s71167ye(v=VS.110,d=hv.2).aspx
The M:System.Net.WebHeaderCollection.Add(System.Net.HttpRequestHeader,System.String) method throws an T:System.ArgumentException if you try to set one of these protected headers.
so I can only modified code to pass the HttpWebRequest out when it is ready to work。