In C# I can override WebClient.GetWebRequest method in order to change HTTP version.
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);
request.ProtocolVersion = System.Net.HttpVersion.Version10;
return request;
}
I have to change HTTP request version to 1.0 before invoking web service using New-WebServiceProxy.
Is there a way to change this?
Set the ProtocolVersion field to version10. Like so,
$hr = [system.net.httpwebrequest]::create("http://www.example.com")
$hr.ProtocolVersion = [system.net.httpversion]::version10
Mind you, unlike C#, Powershell (and .Net API bindings) are note case sensitive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With