Ive been trying to automate posting to one site for a while now and the code suddenly started failing with the message 417 expectation failed. Im using vb.net and the httpwebrequest and httpwebresponse classes.
The problem apparently is that the request gets sent with a Expect:100 continue header that this server doesn’t seem to like. Reverting back to http 1.0 wasn’t the best solution obviously…
The solution was to use set the property .ServicePoint.Expect100Continue of the webrequest to False.
Setting this worked fine, but when I used a proxy with the call, it failed as the proxy sent the 100 continue header on its own. The solution that I finally found was to add this code in your app.config file
<configuration>
<system .net>
<settings>
<servicepointmanager expect100Continue="false" />
</settings>
</system>
</configuration>
This works perfectly now
Incoming search terms:
- commision activator
- HttpWebResponse (417) Expectation failed
- httpwebrequest expect 417
- vb net 417 expectation failed
- vb net HttpWebResponse location
- vb net httprequest 417
- httpwebresponse expect100continue
- (HttpWebResponse)WebReq GetResponse() (417) Expectation failed
- HttpWebRequest Proxy 417
- expectation failed vb net
Comments on this entry are closed.