When I try to POST to a URL it results in the following exception:
The remote server returned an error: (417) Expectation Failed.
Check that your network connection isn't redirecting.
I had this issue when on the wrong wifi and any web request was redirecting to a corporate login page.
Another way -
Add these lines to your application config file configuration section:
<system.net>
<settings>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>
System.Net.HttpWebRequest adds the header 'HTTP header "Expect: 100-Continue"' to every request unless you explicitly ask it not to by setting this static property to false:
System.Net.ServicePointManager.Expect100Continue = false;
Some servers choke on that header and send back the 417 error you're seeing.
Give that a shot.
For Powershell it is
[System.Net.ServicePointManager]::Expect100Continue = $false