getting cookie with webreqest

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
I am trying to get the login cookie for a site but am getting a 417 error. I read that i need to disable expect 100 continue? i am suppose to set it to false in a couple places? How do i do that?
VB.NET:
        ServicePointManager.Expect100Continue = False
I tried putting that before the webrequest but still 417.
 
am getting a 417 error. I read that i need to disable expect 100 continue?
That is correct. (or else another Expect header was set where expectation can't be met)
ServicePointManager.Expect100Continue Property said:
Changing the value of this property does not affect existing ServicePoint objects. Only new ServicePoint objects created after the change are affected.
If you're getting 417 after setting that it means your request still has sends the Expect header, which means you have an existing ServicePoint that was created prior to changing ServicePointManager. You can debug this by using Fiddler or other tools to see what headers your requests are actually sending.
So you need to set it globally earlier, or change the Expect100Continue property for the individual request servicepoint: HttpWebRequest.ServicePoint Property (System.Net)
 
Back
Top