write down,forget

This header must be modified using the appropriate property

<Category: .NET> 查看评论

 

You can see above that copying the headers collection from one request into another is going to cause the problem.  The following is a list of request and response headers that must be set via properties instead of headers collection.  These properties will be translated to headers on the wire:

 

Header Restricted on Request Restricted on Response
Accept true – use .Accept property false
Connection true – use .Connection property false
Content-Type true – use .ContentType property false
Content-Length true – use .ContentLength property true – use .ContentLength property
Date true false
Expect true – use .Expect property false
Host true false
If-Modified-Since true – use .IfModifiedSince property false
Keep-Alive false true
Proxy-Connection true – use .Proxy property false
Range true false
Referer true – use .Referer property false
Transfer-Encoding true – use .TransferEncoding property true
User-Agent true – use .UserAgent property false
WWW-Authenticate false true

本文来自: This header must be modified using the appropriate property