0

错误:

Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send

via : proxy 

powershell 4.0 版,相同的请求适用于更高版本的 powershell

试图调用网络请求

$headers = @{ "Authorization" = "Bearer 7jNQ0nL"}
Invoke-WebRequest  -Uri https://api.line.me/v2/bot/user/all/richmenu  -Method Get  -Proxy proxy.xx.xxxnet.com:8080 -ProxyUseDefaultCredentials  -Headers $headers

但这就是发生的事情:

Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Invoke-WebRequest  -Uri https://api.line.me/v2/bot/user/all/richmenu  -Method Ge ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
4

0 回答 0