7

I am creating an http proxy using AWS Api Gateway. I would like to hard code some of the headers and their values to be forwarded as part of the request. I thought this might be possible in the 'Integration Request' portion of the proxy setup, but I can't seem to figure it out.

I'm trying to pass an Authorization header with an oauth key. I don't want to share this key with clients that have access to this service, since I will only provide a subset of access to users of this specific endpoint.

4

2 回答 2

11

在集成请求中,您可以通过将值放在单引号内来配置要发送到集成端点的静态标头值,例如'my_static_header_value'.

于 2015-09-21T03:50:20.377 回答
0

将那些硬编码的标头放在请求正文中是否有问题?不是,您可以只使用模板(在集成请求屏幕中):

{
  "hardcoded_header": "$input.params('hardcoded_header')"
}

希望这可以帮助。

于 2015-07-30T21:47:37.630 回答