我想问一下关于AbuseIPDB的AbuseIPDB命令,如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
我想知道我在这里做错了什么?非常感谢你的指点/答案。
发布于 2022-04-20 12:03:42
header的参数应该接收字典(一次),而不是字符串(多次)。
curl ... -H @{ "Key" = "$MYKEY"; "Accept" = "application/json" }
https://stackoverflow.com/questions/66759799
复制相似问题