小编kuk*_*_94的帖子

在cURL中使用HTTP标头传递API密钥

我在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)

当我修改我的策略以查找查询参数而不是标题中的键时,它可以正常工作.我在这里错过了什么吗?

powershell curl apigee

13
推荐指数
3
解决办法
3万
查看次数

标签 统计

apigee ×1

curl ×1

powershell ×1