首页 > 解决方案 > 错误 cURL AbuseIPDB 通过 Powershell 命令 - 无法绑定参数“标头”

问题描述

我想询问有关 AbuseIPDB 的 cURL 命令,如https://docs.abuseipdb.com/#check-endpoint中所述

所以我尝试使用以下 Powershell curl 命令运行该命令”

curl -G https://api.abuseipdb.com/api/v2/check \  --data-urlencode "ipAddress=118.25.6.39" \  -d maxAgeInDays=90 \  -H "Key: $MYKEY" \  -H "Accept: application/json"

但是,我收到以下错误描述:

Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Key: " value of type "System.String" to type "System.Collections.IDictionary".
At line:1 char:120
+ ... ys=90 \  -H "Key: $MYKEY ...
+                 ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

我想知道我在这里做错了什么?非常感谢您的指点/答案。

标签: powershellcurl

解决方案


推荐阅读