小编Pet*_*r_M的帖子

Curl 错误:无法处理参数,因为参数名称“u”不明确

我正在尝试通过curl连接(在PowerShell 中), 但没有成功。

下面是我为了建立连接而插入的以下代码:

  curl -u <USER>:<PASSWORD> https://something.com
Run Code Online (Sandbox Code Playgroud)

但收到错误:

  Invoke-WebRequest : Parameter cannot be processed because the parameter name 'u' is ambiguous. 
  Possible matches include: -UseBasicParsing -Uri -UseDefaultCredentials -UserAgent.
Run Code Online (Sandbox Code Playgroud)

于是,我尝试在SO寻找解决方案,例如:

PowerShell 的 Invoke-RestMethod 相当于curl -u(基本身份验证)

在 64 位 Windows 上运行 cURL

在 GitHub 上: https: //github.com/PowerShell/PowerShell/issues/4351

但没有成功。我还在我的机器中重新安装了“curl”并尝试直接使用Invoke-WebRequest,但问题仍然存在。

我是 PowerShell 的新手,也许我在编写这些行时犯了一个错误,但是您对如何处理有什么建议吗?您认为有比 PowerShell 更好的命令提示符/CLI 来使用curl吗?

powershell curl

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

curl ×1

powershell ×1