11
Powershell v3 Invoke-WebRequest HTTPS错误
使用Powershell v3的Invoke-WebRequest和Invoke-RestMethod,我成功地使用POST方法将json文件发布到https网站。 我正在使用的命令是 $cert=New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("cert.crt") Invoke-WebRequest -Uri https://IPADDRESS/resource -Credential $cred -certificate $cert -Body $json -ContentType application/json -Method POST 但是,当我尝试使用GET方法时: Invoke-WebRequest -Uri https://IPADDRESS/resource -Credential $cred -certificate $cert -Method GET 返回以下错误 Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send. At line:8 char:11 + $output = Invoke-RestMethod …
126
.net
rest
powershell
https