我在Apigee中有一個API代理,它使用API密鑰進行身份驗證。我通過使用捲曲我的HTTP請求頭中的關鍵,用這個命令:傳遞帶有HTTP標頭的API密鑰cURL
curl -v -H "apikey: my_key" http://api_org-test.apigee.net/v1/helloapikey
我得到這個錯誤:
Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the
"apikey: my_key" value of type "System.String" to
type "System.Collections.IDictionary".
當我修改我的政策,以尋找在查詢參數的關鍵而不是頭,它工作正常。我在這裏錯過了什麼嗎?