无法从URL Powershell获得响应

elab4d1

我正在尝试从此url获得响应:https://www.dhl.com/shipmentTracking?AWB=4187598402它使用Invoke-RestMethod提供json内容,但始终保持加载状态。我已经尝试过像这样给useragent:Invoke-RestMethod $url -Useragent $userAgent但它仍在加载:https : //i.stack.imgur.com/WnmDg.png

事物管理

有一些东西被缓存或挂在调用PowerShell.exe进程上。这就是为什么关闭PowerShell并重新打开可以解决此问题的原因。一个简单的解决方法是仅在会话中调用PowerShell.exe:

powershell.exe -Command "Invoke-RestMethod 'https://www.dhl.com/shipmentTracking?AWB=4187598402'"

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章