我在Apigee中有一个API代理,它使用API密钥进行身份验证.我使用cURL使用我的HTTP请求标头传递密钥,使用以下命令:
curl -v -H "apikey: my_key" http://api_org-test.apigee.net/v1/helloapikey
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the
"apikey: my_key" value of type "System.String" to
type "System.Collections.IDictionary".
Run Code Online (Sandbox Code Playgroud)
当我修改我的策略以查找查询参数而不是标题中的键时,它可以正常工作.我在这里错过了什么吗?